Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use XSL FO file to layout PDF using iText

I have a requirement of converting graphics(Java2D objects) and some tables into PDF. I also need the PDF to be interactive. Keeping these requirements in mind I came to a conclusion that I should use iText for this purpose. Now I also need to provide the ability to layout the file using XSL FO. I know that Apache FOP provides the ability to render the PDF using XSL FO but it does not support adding annotations (like comments, links).

Is there a way I can do this(layout using XSL) with iText?
It would be helpful even if there is a way where I use both the libraries and serve the purpose.

like image 249
themanwhosoldtheworld Avatar asked Jan 30 '13 10:01

themanwhosoldtheworld


1 Answers

No, iText is not an XSLFO processor. Thus this is not directly possible. However, you could first generate the PDF through an FO Processor like ( Apache FOP or RenderX XEP ) and in a second step post-process it using iText to add the annotations like comments.

like image 194
marcomeyer Avatar answered Sep 27 '22 20:09

marcomeyer