Excel / Doc to PDF conversion using Acrobat9

Excel / Doc to PDF conversion using Acrobat9

Hi,

I need to convert .xls / .doc files to .pdf files using Acrobat9. Please suggest the possible ways.

Thanks in advance.

View Answers

January 14, 2010 at 3:07 PM

Hi Friend,

We have used itext api and POI library to convert doc file into pdf file.

import java.io.*;
import com.lowagie.text.*;
import com.lowagie.text.pdf.PdfWriter;
import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.extractor.WordExtractor;

public class ConvertDocToPDF {
public static void main(String[] args) {
File file = null;
WordExtractor extractor = null ;
try {

file = new File("New.doc");
FileInputStream fis=new FileInputStream(file.getAbsolutePath());
HWPFDocument document=new HWPFDocument(fis);
extractor = new WordExtractor(document);
String [] fileData = extractor.getParagraphText();
String st="";
for(int i=0;i<fileData.length;i++){
if(fileData[i] != null)
st+=fileData[i]+" ";
}
Document doc=new Document();
PdfWriter.getInstance(doc,new FileOutputStream("Hello.pdf"));
doc.open();
doc.add(new Paragraph(st));
doc.close();
file.delete();
}
catch(Exception e){}
}
}

Hope that it will be helpful for you.
Thanks









Related Tutorials/Questions & Answers:
Excel / Doc to PDF conversion using Acrobat9 - Development process
Excel / Doc to PDF conversion using Acrobat9  Hi, I need to convert .xls / .doc files to .pdf files using Acrobat9. Please suggest the possible... and POI library to convert doc file into pdf file. import java.io.*; import
convert excel into pdf
convert excel into pdf  How to convert excel into pdf files
Advertisements
Reports to pdf conversion
Reports to pdf conversion  I need to convert reports into pdf format using java.. Will i get any sample code
pdf to xml conversion
pdf to xml conversion  i want to convert pdf file into xml file.. where i am having a table in pdf file with some headers and some data into it. i want the headers to be the tag of xml file. how can i do that using java? please
Excel conversion tool. - Java Beginners
Excel conversion tool.  Hi, I need a conversion tool which can convert .xls(Excel 2003) to .xlsx (Excel 2007) and vice-versa. Please suggest any links ro tools. Thank You
Byte array to PDF Conversion
Byte array to PDF Conversion  Hi, Am getting a letter Format in Byte array and i have to display that in PDF.Is that possible in PHP ? If so please let me knw how should i ? I can able to display that in a word Document but i
doc to pdf convertion - Java Beginners
doc to pdf convertion  hi , I need to convert a .doc file that contains tables,pictures and text to pdf using Itext. I tried but it convert only texts. code i tried is package de.vogella.pdf.write; import java.io.
PDF to Word Conversion - Java Beginners
PDF to Word Conversion  Hello, Can we convert a PDF document to Microsoft word document thru Java. If its not possible in Java, is it possible in any other language
onfly conversion of jsp to pdf (urgent) - Development process
onfly conversion of jsp to pdf (urgent)  Hi, i m facing problem to convert jsp to pdf on on fly, i have an application in which there is some... (in PDF form) on a button click event all the text in jsp is dynamic comes from
openning the pdf or doc file in same jsp
openning the pdf or doc file in same jsp   **how to open the pdf and doc file in same jsp after clicking the link or button (which is with out moving to the next page). will some body help me on this @simple format please
generate pdf using jsp
generate pdf using jsp  how do i generate a pdf using jsp that should query the data from the database and write it into a pdf and download the same
To save table format data in pdf/excel in jsp
To save table format data in pdf/excel in jsp  Hello, I am doing web... table. So my question is ,I want so save this html format data in pdf/excel format... can save html table data in pdf/excel format.Your inputs are valuable to me
Reading .doc file using swing
Reading .doc file using swing  Sir, Could U Please Tell me the Way To Read .doc file in java using swing,with code
regarding the pdf table using itext
regarding the pdf table using itext  if table exceeds the maximum width of the page how to manage
convert html to excel using jsp
convert html to excel using jsp   i want to convert a html page into mcrosoft excel page using jsp.how i do
update excel sheet using jsp::
update excel sheet using jsp::   Hi Sir,... I have a excel... given excel sheet and display it into another excel sheet using jsp" i am using 'session' to get the empid from one page to another jsp
how to use Excel Templet to write excel file using java.
how to use Excel Templet to write excel file using java.  how to use Excel Templet to write excel file using java
excel file using JDBC java.?
excel file using JDBC java.?  hey, i am a telecomm. engineer , and i am try to develop a tool which reads from a excel file and then appends the same... used JDBC ODBC to read from excel file. i am not able to append it using
Excel file wriring using java
Excel file wriring using java  i have one predefined bill format in excel i want to append values in it using java apche POI or Jexcel i tried it but it overwrites file and lost previous contents what can i do
how to use Excel Template to write excel file using java
how to use Excel Template to write excel file using java  How to use Excel template to write data in that file using java
Exporting to excel using display tag?
Exporting to excel using display tag?  Hai , I am implementing pagination in struts.It has export to excel option.When I am clicking... to excel option.Please help me on this. Regards, N.Santosh
how to create an excel file using java
how to create an excel file using java  how to create an excel file using java
how to create pdf file using java and itextjar
how to create pdf file using java and itextjar  How to create pdf file having paragraphs and alignments done using java and itextjar 5.10 version.? hope i get quick response
how to create pdf file using java and itextjar
how to create pdf file using java and itextjar  How to create pdf file having paragraphs and alignments done using java and itextjar 5.10 version.? hope i get quick response
Create SpreadSheet same as excel using java applet
Create SpreadSheet same as excel using java applet  Hi Ji, May i know to create new excel sheet using java Applet
Create SpreadSheet same as excel using java applet
Create SpreadSheet same as excel using java applet  Hi Ji, May i know to create new excel sheet using java Applet
Show pdf's in web browser by using jsp?
Show pdf's in web browser by using jsp?  Hi, I want to display pdf file in browser by clicking the link, available in JSP page. When am trying to do this by using Anchor tag with absolute path, it is showing the error as: Http
form field mapping with pdf file using java
form field mapping with pdf file using java   Hai all, I have one requirement that i have one html form.i have to map the form fields with pdf... related to the field in pdf file should marked with a color. can any one give
Linking excel file with a application tool using swing
Linking excel file with a application tool using swing  I have to link an excel file with my application software using java swing.As soon as i click on the link button a window should open for selecting the excel file(just like
downloading excel file using Java and springs
downloading excel file using Java and springs  I need to find out how to download an excel file using the spring framework in java. Please help me out as I am new to springs and its urgent
To read & write a excel file using the core java
To read & write a excel file using the core java  Hai, I'm new to JavaProgram.But now i need java program to read & write a excel file so, can anyone help me to learn the above mentioned topic(link for the portion
How to insert a single page PDF file into another multipage PDF file using iText? - Java Beginners
How to insert a single page PDF file into another multipage PDF file using iText?  Hi ALL: I have two PDF files. PDF-A.pdf is a multipage PDF file. PDF-B.pdf is a single page PDF file. I want to insert PDF-B into PDF-A only
Convert ZIP To PDF
;  Lets discuss the conversion of a zipped file into pdf file... into the string by using the string class constructor.Generate a pdf file... this paragraph to the document by using doc.add(p). Create a pdf file
pdf to text
pdf to text  how to covert pdf file (which contain table and text) into word or excel file using itext api
Import object in Excel using java swing
Import object in Excel using java swing  Hi sir, I want to make a swing application where I can import a object by clicking a button. I am using.... The details of the excel operation which i want to do by one click: in excel its
Excel Created using POI and HSSF - Development process
Excel Created using POI and HSSF  Hi i ceated excel file using jakarta poi library i want to add Percentage formula to cell i am not able to do that can you please suggest me how do i add formula c3.setCellValue("Percentage
in Spring MVC, i would like to download my Mysql database table in pdf,msword,excel formats.
in Spring MVC, i would like to download my Mysql database table in pdf,msword,excel formats.  in Spring MVC, i would like to download my Mysql database table in pdf,msword,excel formats: in View: radio buttons: pdf 2. mswod
excel sheet reading and using that data - JSP-Servlet
excel sheet reading and using that data  i have to do a read a excel sheet file of a employee record and then i have to use a employee details to send mail to those employees how to do in jsp sir please help me sir.. Thanks
Merge multiple jasper file to one word Doc using java
Merge multiple jasper file to one word Doc using java   how to Merge multiple jasper file to one word Doc using java
How to Create Excel Page Using JSP
how to create excel page using jsp   ... using pure word files using Java. We can create, read or write MS Excel file using.... It is top most class for creating new excel sheets ,doc sheets etc.  You
How to generate the pdf file using jsp - JSP-Servlet
How to generate the pdf file using jsp  Hi how to generate the pdf file in jsp  Hi Friend, Try the following code: Thanks
how to convert doc file into html using java swing
how to convert doc file into html using java swing  i want to convert doc file into html and display it on jtextarea please help me and give the sample code
Sql to excel
Sql to excel  How to convert a Sql Data into excel Doc with Using Netbeans
How to delete excel file records using Store Procedure?
How to delete excel file records using Store Procedure?  Hi.. I have created one Excel file through stored procedure.Now I want to delete records or delete excel file. Thanks
Create Excel Sheet Using JSP
create excel sheet using jsp   ... into excel sheet using java .You can create any number of cells and rows... types into cell by using this method. In this example, we have used four data types
How to export data from jsp to excel sheet by using java
How to export data from jsp to excel sheet by using java   How to export data from jsp to excel sheet by using java
How to export data from html to excel sheet by using java
How to export data from html to excel sheet by using java   How to export data from html to excel sheet by using java
Read Excel data using JSP and update MySQL databse
Read Excel data using JSP and update MySQL databse  HOw to read excel data using JSP and update MySQl database
How I can filling pdf file that crated by livecycle using itext
How I can filling pdf file that crated by livecycle using itext  I have pdf file that already done by livecycle.. I read it then I used the pdfstamber class to manipolute and filling file.... the result it will be a new pdf file
Open a .doc file by click on the link using struts - Struts
Open a .doc file by click on the link using struts   I want to open a doc extension file when i click a link on jsp page .I know only about which is write in web.xml but not exactly know how i do this.Plz any one can help me

Ads