• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

PDF generation

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
 
And then we all jump out and yell "surprise! we got you this tiny ad!"
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic