Michael Schierl wrote:
> The same exception is thrown if I include the PdfContentByte of that page
> and copy it over to the new document.

What do you mean by this? A PdfImportedPage or just a content stream?

> I removed that part from the example
> to make it clear that the hyperlinks are the culprit.

Can you confirm that the hyperlink problem also existed in older versions?

>> Unless Michael can explain what he expects to happen.
> 
> The hyperlink that happens to be the first one of the hyperlinks on the
> first page of the source PDF should be "copied" onto the first page of the
> new PDF (i. e. clicking the same position should result in browsing to the
> same location).

The first link on the first page of pagefour.pdf refers to the
page with reference 27 0 R; in other words to object 27 which is
the page dictionary of page 3.
When you copy this link to a new document, there is no page 3 yet.
You can't use "27 0 R" because you don't even know if object 27 exists
(or if it contains a page dictionary).

> The same exception appears if I use a loop to move all the hyperlinks. And
> it still appears if I transform/scale the rectangles of hyperlinks.

All this seems irrelevant to me.
The links don't point to a valid page anymore when you "copy" them.

> And, it still crashes, if you use jPDF Tweak and let it rescale the PDF
> (scaling both the content and the hyperlinks) to, say, A3 format.
> 
> Perhaps you could be so kind and explain me why rescaling a PDF like this
> does not make sense?

Because using the combination PdfReader/PdfWriter is not the way to go?
Why don't you use PdfReader/PdfStamper?

BUT BEFORE WE GO ON: can you please confirm that the "new" problem
also existed in older iText versions?

AND can you confirm that you were mistaken when you said the "initial"
problem persisted on page 4 of pagefour.pdf?
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to