-
convert word and excel to PDF using JAVA API (17 messages)
- Posted by: Deepa Lalukota
- Posted on: December 09 2005 11:08 EST
I have to develop an appplication which uploads excel file with an attachments word and PDF .i need to convert all formats to pdf and merge all PDF's into one PDF.can anyone help me in how i can write the code using JAVA.IT is very urgent
Thank You
DeepaThreaded Messages (17)
- convert word and excel to PDF using JAVA API by c b on December 09 2005 14:14 EST
- JExcel better than POI by A. J. on December 12 2005 08:39 EST
- JXEL by Nikhilesh Fonseca on December 30 2005 01:16 EST
- JExcel better than POI by A. J. on December 12 2005 08:39 EST
- convert word and excel to PDF using JAVA API by David Thielen on December 11 2005 11:01 EST
- no titles by james jeffclub on January 19 2006 03:45 EST
- implementation solution by saifeldeen hadid on January 25 2006 00:14 EST
- having the same request...:) by Moldovan Radu Adrian on August 04 2006 05:34 EDT
- problem with getSheetAt() on workbook in apache poi by srinivas sanga on November 04 2007 08:34 EST
- Re: convert word and excel to PDF using JAVA API by Zet Ucu on January 15 2009 10:43 EST
- Re: convert word and excel to PDF using JAVA API by chee khen liew on April 05 2009 13:22 EDT
- Excel to pdf free trial by Mossloy Mossloy on December 23 2009 02:12 EST
- excel tp pdf by Preeti Dixit on December 08 2010 06:13 EST
- convert to PDF using JAVA by Susan Sims on January 21 2011 16:13 EST
- convert word and excel to PDF using JAVA API by Jie Hua on July 03 2012 02:08 EDT
- convert word and excel to PDF using JAVA API by Raju Gajipara on July 11 2012 07:38 EDT
- http://www.interiordesigner.ro by ed norton on July 17 2012 10:11 EDT
-
convert word and excel to PDF using JAVA API[ Go to top ]
- Posted by: c b
- Posted on: December 09 2005 14:14 EST
- in response to Deepa Lalukota
I would look into a jakarta poi (which does the excel java api) and then apache fop or itext library for the pdf creation.
hope that helps,
www.binaryfrost.comI have to develop an appplication which uploads excel file with an attachments word and PDF .i need to convert all formats to pdf and merge all PDF's into one PDF.can anyone help me in how i can write the code using JAVA.IT is very urgent Thank YouDeepa
-
JExcel better than POI[ Go to top ]
- Posted by: A. J.
- Posted on: December 12 2005 08:39 EST
- in response to c b
Having used both POI and JExcel, it is my opinion that JExcel is the better of the two apis. JExcel operates on lesser heap memory for a given spreadsheet. In fact ive had to rewrite code using POI to now use JExcel... -
JXEL[ Go to top ]
- Posted by: Nikhilesh Fonseca
- Posted on: December 30 2005 01:16 EST
- in response to A. J.
Jxel Api is a lot simpler compared to POI ...it took us hardly 15 minutes to download & implement the APi
Cheers Andy... -
convert word and excel to PDF using JAVA API[ Go to top ]
- Posted by: David Thielen
- Posted on: December 11 2005 11:01 EST
- in response to Deepa Lalukota
-
no titles[ Go to top ]
- Posted by: james jeffclub
- Posted on: January 19 2006 03:45 EST
- in response to Deepa Lalukota
I thought, he pays attention is not merely the excel data conversion is the pdf form, but also includes some page layout forms, the picture and so on, the data is the data conversion merely, causes extremely simply, the stupidest method is itext Unifies with poi:)
I come from china,my English is very bad:) -
implementation solution[ Go to top ]
- Posted by: saifeldeen hadid
- Posted on: January 25 2006 00:14 EST
- in response to Deepa Lalukota
Hi Deepa, what did you end up using? We have a similar requirement in my current project. I did some initial investigation of using POI then FOP however I am not sure this is the right way to go because of relying on too many subsystems.
I would be interested to know what you are doing with your solution.
Kind Regards,
Saifeldeen -
having the same request...:)[ Go to top ]
- Posted by: Moldovan Radu Adrian
- Posted on: August 04 2006 05:34 EDT
- in response to Deepa Lalukota
Hello all, So, what was the final solution for this open point. best regards, MODLOVAN Radu -
problem with getSheetAt() on workbook in apache poi[ Go to top ]
- Posted by: srinivas sanga
- Posted on: November 04 2007 08:34 EST
- in response to Deepa Lalukota
Hi All, we are using apache poi API. My application is working only when .xls file open&close once before run the application. Is there any properties should be changes for file? Do you want to me use JExcel? please, help me . Thanks in advance.. -
Re: convert word and excel to PDF using JAVA API[ Go to top ]
- Posted by: Zet Ucu
- Posted on: January 15 2009 10:43 EST
- in response to Deepa Lalukota
Another solution for DOC to PDF, HTML to PDF: http://www.dancrintea.ro/html-to-pdf/ check page middle for example. -
Re: convert word and excel to PDF using JAVA API[ Go to top ]
- Posted by: chee khen liew
- Posted on: April 05 2009 13:22 EDT
- in response to Deepa Lalukota
I managed to converted RTF/Doc files to PDF using OpenOffice, here my steps: 1) Installed OpenOffice 2.4 (I failed to compile in OpenOffice 3 coz they have changed the jar files folder structure) 2) You need these 3 files in your classpath: unoil.jar, juh.jar, ridl.jar You will find them in: "C:\Program Files\OpenOffice.org 2.4\program\classes" (Note: Do NOT copy out these 3 files, you must linked them in the original location, or else you will get runtime error for not able to find the executable) ---------------------------------- try { // get the remote office component context com.sun.star.uno.XComponentContext xContext = com.sun.star.comp.helper.Bootstrap.bootstrap(); // get the remote office service manager com.sun.star.lang.XMultiComponentFactory xMCF = xContext.getServiceManager(); Object oDesktop = xMCF.createInstanceWithContext( "com.sun.star.frame.Desktop", xContext); com.sun.star.frame.XComponentLoader xCompLoader = (com.sun.star.frame.XComponentLoader) UnoRuntime.queryInterface( com.sun.star.frame.XComponentLoader.class, oDesktop); java.io.File file = new java.io.File(sourceFile); StringBuffer sLoadUrl = new StringBuffer("file:///"); sLoadUrl.append(file.getCanonicalPath().replace('
', '/')); file = new java.io.File(outputFile); StringBuffer sSaveUrl = new StringBuffer("file:///"); sSaveUrl.append(file.getCanonicalPath().replace('
', '/')); com.sun.star.beans.PropertyValue[] propertyValue = new com.sun.star.beans.PropertyValue[1]; propertyValue[0] = new com.sun.star.beans.PropertyValue(); propertyValue[0].Name = "Hidden"; propertyValue[0].Value = new Boolean(true); Object oDocToStore = xCompLoader.loadComponentFromURL( sLoadUrl.toString(), "_blank", 0, propertyValue ); com.sun.star.frame.XStorable xStorable = (com.sun.star.frame.XStorable)UnoRuntime.queryInterface( com.sun.star.frame.XStorable.class, oDocToStore ); propertyValue = new com.sun.star.beans.PropertyValue[ 2 ]; propertyValue[0] = new com.sun.star.beans.PropertyValue(); propertyValue[0].Name = "Overwrite"; propertyValue[0].Value = new Boolean(true); propertyValue[1] = new com.sun.star.beans.PropertyValue(); propertyValue[1].Name = "FilterName"; propertyValue[1].Value = "writer_pdf_Export"; xStorable.storeToURL( sSaveUrl.toString(), propertyValue ); System.out.println("\nDocument \"" + sLoadUrl + "\" saved under \"" + sSaveUrl + "\"\n"); com.sun.star.util.XCloseable xCloseable = (com.sun.star.util.XCloseable) UnoRuntime.queryInterface(com.sun.star.util.XCloseable.class, oDocToStore ); if (xCloseable != null ) { xCloseable.close(false); } else { com.sun.star.lang.XComponent xComp = (com.sun.star.lang.XComponent) UnoRuntime.queryInterface( com.sun.star.lang.XComponent.class, oDocToStore ); xComp.dispose(); } System.out.println("document closed!"); System.exit(0); ---------------------------------- Hope that helps, enjoy! -
Excel to pdf free trial[ Go to top ]
- Posted by: Mossloy Mossloy
- Posted on: December 23 2009 02:12 EST
- in response to Deepa Lalukota
-
excel tp pdf[ Go to top ]
- Posted by: Preeti Dixit
- Posted on: December 08 2010 06:13 EST
- in response to Mossloy Mossloy
Hi deepa,
did you get any solution for this situation.I also have the same requirement.
please help.
-
convert to PDF using JAVA[ Go to top ]
- Posted by: Susan Sims
- Posted on: January 21 2011 16:13 EST
- in response to Deepa Lalukota
Java tools for converting images to and from PDF, and now to convert from Word to PDF are available from Qoppa Software. Low cost, conform to PDF standards, reliable, documentation and demos available.
-
convert word and excel to PDF using JAVA API[ Go to top ]
- Posted by: Jie Hua
- Posted on: July 03 2012 02:08 EDT
- in response to Deepa Lalukota
I have to develop an appplication which uploads excel file with an attachments word and PDF .i need to convert all formats to pdf and merge all PDF's into one PDF.can anyone help me in how i can write the code using JAVA.IT is very urgent
Thank You
DeepaHave you tried use iText?
-
convert word and excel to PDF using JAVA API[ Go to top ]
- Posted by: Raju Gajipara
- Posted on: July 11 2012 07:38 EDT
- in response to Jie Hua
You can try following method to merge all PDF 's in a single file
<code>
public void generateSingleFile(ArrayList lstFileNames,String rptrootpath,String newFileName) throws DocumentException, IOException { PdfReader reader = null; PdfCopyFields copy = new PdfCopyFields(new FileOutputStream(rptrootpath + newFileName)); try { int pageCount = 0; String rptfile = ""; for(int j=0; j<lstFileNames.size(); j++) { rptfile = (String)lstFileNames.get(j); if( ( rptfile != null) && ( !rptfile.equals("")) ) { File file = new File(rptrootpath + rptfile); if (file.exists())//if file not exist { reader = new PdfReader(rptrootpath + rptfile); pageCount = reader.getNumberOfPages(); }else { pageCount = 0; } if(pageCount>0) { copy.addDocument(reader); } logger.debug("There are " + pageCount + " pages in the original file."); } } if(copy!=null)copy.close(); if(reader!=null)reader.close(); }catch (Exception e) { logger.error("Error : ",e); } }
</code>
-
Thankyou[ Go to top ]
- Posted by: Neal Gass
- Posted on: July 16 2012 17:34 EDT
- in response to Raju Gajipara
Thankyou for this code. Greetings
-
http://www.interiordesigner.ro[ Go to top ]
- Posted by: ed norton
- Posted on: July 17 2012 10:11 EDT
- in response to Deepa Lalukota