File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes PDF generation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "PDF generation" Watch "PDF generation" New topic
Author

PDF generation

shahin Khan
Greenhorn

Joined: Mar 04, 2005
Posts: 17
Hi All
My application need is to convert multiple XML files into a single PDF document.I have generated separate XSL files for each xml respectively.
I able to generate a PDF file for a single XML file when i try to generate a PDF file for multiple XML files then the PDF gets overwritten by the last XML document.Can any one help me in this regards
Thanks
Shanu
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12792
    
    5
If I understand your problem correctly, you need to concentrate on combining all of your XML streams into a single XML:FO file which can then be turned into a single PDF document.
Which toolkit are you using for PDF generation?
Bill
shahin Khan
Greenhorn

Joined: Mar 04, 2005
Posts: 17
Hi Bill,
My application gets n no of excel sheets as input which should be converted into single pdf.these are the steps i am following for the conversion
1.To generate the xml files for each excel document i am using POI (HSSF).
2.To generate the xsl files for each XML document i am using SAX.
3.To generate PDF i am using FOP and giving input as a pair of xml and xsl,but the generated PDF contents are overwritten by final pair of xml and xsl.

All the XML and XSL files are generated at run time and for these a single pdf has to be generated,
I have to do this using FOP api only.

My Excel sheet contains images also how to put these images into the PDF document.Can u plz help me
I hope now u have understood the problem and will help me in this regard

Thanks
Shahin
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42043
    
  64
Hello "shanu"-

On your way in you may have missed that there is a policy on screen names here on JavaRanch, and yours does not conform to it. We take this policy serious, so please adjust your screen name right here. Thanks for your prompt attention to this matter.


Ping & DNS - my free Android networking tools app
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42043
    
  64
Two approaches come to mind.

- You can create a "master" XML file, in which the various files to be joined together are declared as entities, and then included in the body. FOP can deal with that, and will then create a single PDF file.

- After you have created the PDF files (under different names), you can use the iText library to join them together. iText even has a short demo program that shows how to concatenate PDF files.

Images are supported through something like the following:
 
jQuery in Action, 2nd edition
 
subject: PDF generation