Home Answers Viewqa Development-process 8211-Excel- Excel / Doc to PDF conversion using Acrobat9

 
 


Manoj
Excel / Doc to PDF conversion using Acrobat9
1 Answer(s)      3 years and 5 months ago
Posted in : Development process

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 Pages:
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
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.
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
Convert ZIP To PDF
in this pdf file by using the code PdfWriter.getInstance (doc, new...;  Lets discuss the conversion of a zipped file into pdf file... by using the string class constructor.Generate a pdf file by using
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
pdf to text
pdf to text  how to covert pdf file (which contain table and text) into word or excel file using itext api
convert excel into pdf
convert excel into pdf  How to convert excel into pdf files
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
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
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
download pdf files
download pdf files  pls help me,I don't know how to convert .doc,.docx files into pdf files and download that pdf files using servlet or jsp
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
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
Convert Text To PDF
required for the conversion of a text file into the pdf file from http...;)) for creating a PDF document writer. 3. Open the document by using doc.open... Convert Text To PDF      
jsp to excel - JSP-Servlet
jsp to excel  Hi All, I'm writing a program of jsp to Excel conversion with Using POI. My problem is i'm unable to put multiple data into excel...)); } FileOutputStream fileOut = new FileOutputStream("c:\\excel\\wct.xls
sending doc files - Swing AWT
sending doc files  how to send doc file using java from one machine to other over a network
Convesion of txt file to doc file.??????
Convesion of txt file to doc file.??????  how to convert text file to doc file using java
excel
excel  how to save excel sheet data into the database using poi api?   import java.io.*; import java.sql.*; import java.util.*; import java.util.regex.*; import org.apache.poi.hssf.usermodel.
pdf list
pdf list       In this program we are going to know how we can make a list in a pdf file irrespective... and use pdf file in our program. Now create a file named listDemo. Remember
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
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
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 New Excel Sheet Using JSP
How to create new excel sheet using jsp  ... a new  excel sheet using java .You can create any number of  new excel sheets in a excel file.  To create a excel sheet we can use third party APIs
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
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... class for creating new excel sheets ,doc sheets etc.  You have to follow
Java code for conversion between .xls and .xlsx or vice versa - Development process
Excel sheets. The problem is I'm using MS Excel 2003 (.xls format) and clients may be using MS Excel 2007 / 2010 (.xlsx) format. I need a solution...Java code for conversion between .xls and .xlsx or vice versa  I've
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
String conversion
String conversion  I want to convert a string of mix cases(lower and upper case) to vice versa. ex. HellO should be printed to hELLo. the string comes from user using datainputstream. Also sending individual chars of string
upload pdf
upload pdf   i want to dispal content of pdf fil and stored into database in human readable form using php . how can i do
how to create xml schema from xml doc using java
how to create xml schema from xml doc using java  i want to create xml schema from xml document programatically using java... am using Netbeans IDE... need to create the xml schema for that document and send both xml doc ans schema
itext pdf
itext pdf  i am generating pdf using java i want to do alignment in pdf using java but i found mostly left and right alignment in a row. i want to divide single row in 4 parts then how can i do
About search and replace contains of .doc or .docx file using java.
About search and replace contains of .doc or .docx file using java.  Hi , I am trying to replace contents of ms.word document in .doc or .docx... any one tell me how could I replace them using java
how to store/retrieve doc file - Java Beginners
how to store/retrieve doc file  i want to wirte a code that stores/ retrieves .doc files to the mysql database using jsp pages... can anyone help me with the code?  Use this stuff inside your jsp page for store file
How to read the .doc/ .docx file in Java Program
How to read the .doc/ .docx file in Java Program  Hi, I am beginner in Java programming language. Can anybody explain How to read .doc file in Java...; Hi, In java programming language we normally using the POI Library
regarding the pdf table using itext
regarding the pdf table using itext  if table exceeds the maximum width of the page how to manage
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
Pdf Viewer
Pdf Viewer   How to diplay the pdf files in java panel using... = file.getName(); return filename.endsWith(".pdf"); } public String getDescription() { return "*.pdf"; } } For the above code, you
Apache POI API for Microsoft Doc's Manipulation
; of Microsoft excel Documents : Create Simple Excel(.xls) document using Apache POI  Read Simple Excel(.xls) document using Apache POI...(.xlsx) document using Apache POI Read Excel(.xlsx) document using Apache
Excel to database
Excel to database  Hi I want to update SQL database with the values from excel using java code. Can you help me
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 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
Conversion - Development process
is the theory of conversion from java to .NET? How it is done?   Hi.... Java applications can convert to C# using the Microsoft Java Language Conversion Assistant (JLCA). Code that calls Java APIs can convert to comparable C# code
How to insert image in PDF file in struts2
How to insert image in PDF file in struts2 In this example, we will see how to insert image in PDF file using struts2.2.1 framework.. index.jsp <...; <body> <a href="addImage.action">Add Image in PDF
ResultSet Object data to Ms-Word Doc
ResultSet Object data to Ms-Word Doc   help me , i don't know how to write data from oracle database into MSWord document using servlet or jsp
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
JSP TO EXCEL
JSP TO EXCEL  Hi sir/mam, How to import data to excel using jsp without retrieving database.   friend, you can't import excel data into the middle of an HTML pages (your JSP will result in an HTML page
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
pdf generate from jsp
pdf generate from 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