• 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

Convert Excel to PDF. Help please!

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there:
I need to write some code to convert an Excel file to a PDF file. I googled it for 2 days. I could not find an open source java lib that can directly do that. I am thinking about using POI to read the Excel file and then use IText to write the contents out as a PDF. Does anyone have experience with this kind of conversion? Is there any better lib or solutions? Thanks in advance.
 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That sounds like a good start. I don't think you will find any products because there are too many mismatches between the Excel and PDF models to do anything standard. PDF has pages but Excel doesn't. Excel is mainly concerned with rows and columns but PDF isn't. So it's basically up to you to decide how to map from one to the other, and to write code accordingly.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just to second what Paul said - there is no general solution. POI or jExcelAPI are your principal ways of reading an XLS file, and iText or PDFBox are the principal ways to generate a PDF.
 
Yan Hu
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you guys. Now I am testing it using POI and Itext
 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah i believe iText and PDFBox are good tools to create a pdf file By the way, how about parsing a PDF file, got any suggestions? Thanks.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yan, have a look at OpenOffice.org. It reads Excel files and can export as PDF. I'm using it to translate Word docs to HTML and PDF. You control the application through a network object protocol. The API is non-trivial, but there's plenty of examples in the api documentation and forums.
 
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
lhorenz baylon wrote:

how about parsing a PDF file



The Accessing File Formats FAQ -linked in my signature- has some pointers on this.
 
Yan Hu
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you guys.
 
Lorenz Baylon
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks ulf! juz wanna take the oppotunity, is there a particular java class or jar that would enable extracting of images from a pdf file? thanks
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey im also still looking for this
A friend of mine showed me some page, think it was http://exceltopdf.org/ but I keep getting an error message when opening the pdf i created...
Is someone currently using a site or program of which they know it works well?
thank you
 
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lorenz

Pdfbox will do that for you although it depends on the image type I believe:

http://pdfbox.apache.org/
 
reply
    Bookmark Topic Watch Topic
  • New Topic