iText, FOP and Table of contents

  • Follow


Hi,

I am using Apache FOP to generate PDF document from XML FO string. This
string has 'internal-destination' - for links wtihin the document for
Table of Contents and also 'external-destination'.

When PDF is generated just using apache FOP, the links are working
fine.

But I am also using iText as a post PDF processor meaning I pass the
byte array of FOP generated PDF to iText and use PDFReader, PDFWriter
and PDFContentBytes to do some page rotation etc. and write it to a
final PDF file.

The problem is after this iText post PDF processing, the internal links
from table of contents as well as external ones are not working.

Any pointers?

Thanks.

0
Reply KarthikR79 (3) 11/4/2006 11:05:19 AM

I also use addTemplate method while importing the new page.


KarthikR79@gmail.com wrote:

> Hi,
>
> I am using Apache FOP to generate PDF document from XML FO string. This
> string has 'internal-destination' - for links wtihin the document for
> Table of Contents and also 'external-destination'.
>
> When PDF is generated just using apache FOP, the links are working
> fine.
>
> But I am also using iText as a post PDF processor meaning I pass the
> byte array of FOP generated PDF to iText and use PDFReader, PDFWriter
> and PDFContentBytes to do some page rotation etc. and write it to a
> final PDF file.
>
> The problem is after this iText post PDF processing, the internal links
> from table of contents as well as external ones are not working.
> 
> Any pointers?
> 
> Thanks.

0
Reply KarthikR79 11/4/2006 11:11:22 AM


KarthikR79@gmail.com wrote:
> I also use addTemplate method while importing the new page.

And probably also PdfWriter.
That's not the way to do it.
If you want to keep all the interactive features,
you should use either PdfCopy or PdfStamper,
depending on the functionality you need.
PdfCopy doesn't allow you to add new content,
but is able to concatenate different PDF files.
PdfStamper allows you to add new content, but
only works with one PDF document (but you can
insert new pages).
If you want to rotate the pages of one existing PDF,
PdfStamper is ideal for you.
br,
Bruno
0
Reply Bruno 11/6/2006 8:28:11 AM

Thanks Bruno for your help. I got that working fine now.

I used the following to acheive this:
http://threebit.net/mail-archive/itext-questions/msg04484.html

Thanks again!

Bruno Lowagie wrote:
> KarthikR79@gmail.com wrote:
> > I also use addTemplate method while importing the new page.
>
> And probably also PdfWriter.
> That's not the way to do it.
> If you want to keep all the interactive features,
> you should use either PdfCopy or PdfStamper,
> depending on the functionality you need.
> PdfCopy doesn't allow you to add new content,
> but is able to concatenate different PDF files.
> PdfStamper allows you to add new content, but
> only works with one PDF document (but you can
> insert new pages).
> If you want to rotate the pages of one existing PDF,
> PdfStamper is ideal for you.
> br,
> Bruno

0
Reply KarthikR79 11/6/2006 10:19:42 AM

3 Replies
657 Views

(page loaded in 0.072 seconds)

Similiar Articles:













7/20/2012 7:44:40 PM


Reply: