ZF-449: Copy Pages from one document into another

Issue Type: New Feature Created: 2006-10-17T08:20:10.000+0000 Last Updated: 2010-08-10T08:29:38.000+0000 Status: Resolved Fix version(s): - 1.11.0 (02/Nov/10)

Reporter: Lars Piepho (lpiepho) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Pdf

Related issues: - ZF-1309



When I try to render a page from one PDF into another, new PDF, I get the following exception: "Page is attached to one documen, but rendered in context of another." The corresponding code in Page.php on line 427 tells me, that cloning has to be implemented instead of this exception. Is anyone actually working on this and if so is there a release date? I need that function to build a new PDF from several pages of other PDFs.


Posted by Bill Karwin (bkarwin) on 2006-11-13T15:26:53.000+0000

Changing fix version to 0.6.0.

Posted by Alexander Veremyev (alexander) on 2007-05-25T02:26:28.000+0000

Need "deep copy" implementation for PDF objects

Posted by Alexander Veremyev (alexander) on 2007-05-25T02:27:00.000+0000

Postponed to post-1.0 period

Posted by Wil Sinclair (wil) on 2008-04-18T13:11:56.000+0000

This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.

Posted by Ben Scholzen (dasprid) on 2008-09-29T06:36:29.000+0000

Are you serious about this? As far as I could see, this shouldn't be a huge change, and now this is hanging around since 0.6?

Posted by Ben Scholzen (dasprid) on 2008-09-29T07:30:01.000+0000

In my opinion it is not majo anymore, but a blocker. This is one thing among others which prevents me from using Zend_Pdf. Yet FPDF with FPDI are the only good open source option for creating more complex PDFs. If such simple things won't be fixed, you could kinda delete Zend_Pdf to make the Framework more lightweight without any loss. Just my two cents.

Posted by Jozef Hribik (jozef) on 2008-10-24T06:46:51.000+0000

Happy 2-nd birthday to this blocker. You should change the estimation from 4 days to 4 years.

Posted by Willie Alberty (willie) on 2008-12-04T22:34:54.000+0000

Unassigning Zend_Pdf issues currently assigned to me pending decision on ZF 2.0 release timeframe and potential contribution of comprehensive changeset.

Posted by Wil Sinclair (wil) on 2008-12-19T13:02:16.000+0000

@Ben Do you have a patch to submit? @Alex Please evaluate. If this is an issue that we will not address before 1.8, please mark it 'postponed'. We should keep in mind that it has several votes, however, and prioritize it for post-1.8.

Posted by Tim Hawkins (thawkins) on 2009-04-29T14:59:15.000+0000

This issue is a major pain in the butt, it makes dynamic pdf file generation beyond the simple cases difficult.

Im generating reports, a report is a document with lots of variable length sections, I need to be able to have a second pdf doc open with templates for the various page types we use in the report, and be able to create new pages in my report document from the templates as we move through the report generation.

The lack of either of the two following functions makes this a pain.

  1. Clone a page from another doc into the current doc as a new page.


  1. Create a new page in the current document from an existing PDF file (like the "Zend_Pdf:;Load()" function).

Either would sort out my issue.

Posted by clive darr (osde8info) on 2009-05-20T07:21:25.000+0000

only workaround is to use TCPDF ( and instead of Zend !

Posted by Jozef Hribik (muchotravka) on 2009-05-21T11:40:30.000+0000

I already use TCPDF for PDF generation. Hi ZF guys, you should really consider to abandon Zend_Pdf, because it's development stagnates in last 2 years.

Posted by Richard Naik (richardnaik) on 2009-08-20T13:59:38.000+0000

Has there been any progress on this? I'm still having this problem as of ZF 1.9

Posted by aNj (anj) on 2010-02-28T03:25:27.000+0000

Does anyone know how this one will be supported? Please implement this functionality!

Posted by Peter Moolenaar (petermoolenaar) on 2010-04-13T07:40:07.000+0000

The remark about, changing from 4 days to 4 years is getting more and more true. Can the maintainer of this part of the framework shed a bit of light on this (and a lot of other PDF related) issue(s).

Posted by Karl Mikkelsen (kingkarl85) on 2010-06-28T17:43:55.000+0000

I would like even be able to copy a page from within a document - so i can create a base page and duplicate it.

Posted by Steffen Mey (skykid) on 2010-07-28T04:07:07.000+0000

... at least within a pdf document it already works fine with cloning a page (…)

Posted by Alexander Veremyev (alexander) on 2010-08-06T08:10:27.000+0000

I'm proud to inform, that it's done and will be included into ZF 1.11 :)

Four years is really longer than four days :), but there were some additional difficulties.

Posted by Daniel Hartmann (danielmitd) on 2010-08-09T01:32:14.000+0000

congratulations :)

Posted by aNj (anj) on 2010-08-10T08:29:38.000+0000

After this fix, there is a small error:

Parse error: syntax error, unexpected T_VARIABLE in Zend/Pdf/Resource.php on line 93

The const CLONE_MODE_FORCE_CLONING is just in the function placed. Please remove it.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.