.doc to pdf using java

Hi
I need to convert word (doc) format to PDF and PDF to word
It is not possible to do only using iText.jar
If some body know please help me.
can I do this using xsl.I'm not sure since i don't know the format of a word doc

How about eXportXML (http://www.schultz.dk/exportxml/) and iText.
Perhaps, you can translate word -> XML -> PDF.
Good Luck ;-)

Similar Messages

  • Can we identify the tale in pdf using java.Is there any resources to do

    Hello Everyone,
                                From last two weeks onwards,I'm trying to identify the table from pdf.I tried so many libraries in java. But I didn't get any solution for it. If you people know anyone about identifying the table from pdf using java code.Please send me the solution for this.
    Thanks in advance.

    Hi Sandeep,
    You might want to check the docs: http://stackoverflow.com/questions/26092932/how-to-identitfy-tables-images-and-list-in-pdf -file-using-java
    http://stackoverflow.com/questions/10878695/how-to-read-a-table-in-a-pdf-using-itext-java
    http://stackoverflow.com/questions/2699243/find-tables-in-pdfs
    And the discussion on the thread: https://forums.adobe.com/thread/286110?tstart=0
    Regards,
    Rave

  • Not able to produce some Czech characters in pdf using java.

    Hi All,
    I am not able to produce some Czech characters like ě and č in pdf using java. Can you please guide me what could be the cause. The characters are coded in properties file and its just neglecting č and ě and taking other character next to it.
    we have used below code to display the characters but its also not working..first we thought its font issue since Helvetica dont come by default in windows but after putting helvetica font also we are not able to produce the characters.
    BaseFont baseFont = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1250, false);
                   Font fontStyle = new Font(baseFont, 12, Font.NORMAL, Color.BLACK);

    baftos wrote:
    4th paragraph at http://download.oracle.com/javase/6/docs/api/java/util/Properties.html explains it.
    Note also that Java 6 allows you to produce properties files in encodings other than ISO-8859-1, provided you load them via a reader with a matching encoding. (Also see that link posted by baftos.) This might be more practical then the Unicode encoding which was required in earlier versions of Java.

  • Spawn a new PDF using Java Script within LC Designer

    I am trying to spawn a new PDF file to be created from an existing PDF using Java Script within the LC designer
    I have this example but I can't get it to work
    function createPdf()
        pdf = pdf$();
        pdf.addText('Hello World');
        pdf.writeToFile('c:/temp/hello_world.pdf');
        window.open('file://c:/temp/hello_world.pdf');
    Is it possible to create a PDF like this within LC Designer?

    Hi
    I would like to see if it was possible.  I thought it would be easy, as
    there is a standard batch processing sequence (Print 1st page of all) using
    Java that comes with Acrobat 7.  This allows you to print the first page of
    a number of files that you select when the sequence is run.  Its code is:
    /* Print 1st Page */
    /* This sequence prints the first page of
       each document selected to the default printer.
    this.print
    To my uninformed mind it seemed logical that the same code, slightly
    modified to print all pages, should work from within a form.
    Anyway, if there is a way to choose individual files, I would appreciate
    that.
    Thanks
    Rob

  • How to Store word doc in oracle  using java

    hi
    toall
    can any one tell me how to store word doc in oracle9i using java
    bye

    Please refer to
    http://www.databasejournal.com/features/oracle/article.php/3305771

  • Idea  about convert word document to pdf using java api

    idea about convert word document to pdf using java api if any one find it mail me at [email protected]

    api if any one find it mail me at
    [email protected]
    What happend to your other mailID :
    [email protected] ????
    http://forum.java.sun.com/thread.jspa?threadID=639851&
    messageID=3756910It received the Spam Of Death. RIP

  • Print .PDT,.DOC,.XLS files using java print API

    Hi,
    I need to print different types of documents like pdf, word, excel files etc.
    Please let me know how to proceed on this.
    I tried using the following code, but it is printing all junk/html tags on the paper.
    Please let me know how to resolve this.
    Thanks in advance
    import java.io.File;
    import java.io.IOException;
    import javax.print.DocFlavor;
    import javax.print.DocPrintJob;
    import javax.print.PrintException;
    import javax.print.PrintService;
    import javax.print.PrintServiceLookup;
    import javax.print.SimpleDoc;
    public class PrintDocument {
      static public void main(String args[]) throws Exception {
        try {
             PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService();
            DocPrintJob printerJob = defaultPrintService.createPrintJob();
            File pdfFile = new File("C:\\temp\\sample.doc");
            SimpleDoc simpleDoc = new SimpleDoc(pdfFile.toURL(), DocFlavor.URL.AUTOSENSE, null);
            printerJob.print(simpleDoc, null);
        } catch (IOException ie) {
          ie.printStackTrace();
        } catch (PrintException pe) {
          pe.printStackTrace();
    }

    Hi
    I would like to see if it was possible.  I thought it would be easy, as
    there is a standard batch processing sequence (Print 1st page of all) using
    Java that comes with Acrobat 7.  This allows you to print the first page of
    a number of files that you select when the sequence is run.  Its code is:
    /* Print 1st Page */
    /* This sequence prints the first page of
       each document selected to the default printer.
    this.print
    To my uninformed mind it seemed logical that the same code, slightly
    modified to print all pages, should work from within a form.
    Anyway, if there is a way to choose individual files, I would appreciate
    that.
    Thanks
    Rob

  • Can't convert .doc to .pdf using Acrobat 9.4.3.

    Guys,
    Last night for some reason Acrobat 9 suddenly stopped converting any MS Word .docs to .pdfs.  It gives me the following message:
    Acrobat could not open 'XYZ.doc' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).
    To create an Adobe PDF document, go to the source application. Then print the document to Adobe PDF or use the Acrobat toolbar found in Microsoft Office applications.
    I swear it was working earlier. So I checked for an update and it gave me 9.4.3 so I updated and it didn't fix the problem.  I also tried several different files and got the same message.
    I'm using OS 10.6.7 Acrobat 9.4.3 and MS Word 11.3.5 (2004).
    Thanks,
    Solan

    What version of Word do you Have?
    Word 2004 if you had Acrobat as well the PDFmaker menu bar was installed by Acrobat you could convert a .doc Document to PDF.  It required the use of VBA and and a Macro which created the PDFMaker menu.  I was Secretary and Treasurer of an association for 30 years and I converted many a 2004 Word Document to PDF using PDFMaker.
    You still had the same problems with word converted to PDF as today. If there are any section Breaks or Page breaks the pdfs were broken up into pieces you have to put back together.
    I still have some .Doc files from early 2006 and with Office 2011, I opened one, and just saved it as a Pdf no trouble. I didn't convert it and didn't save it as a Docx.
    I simply went to Save as and chose  PDF.
    And I also went to Print menu> PDF> adobe quality PDF.  and was able to make a PDF.
    Also I just went to print menu > PDF and just chose PDF which makes an Apple version of PDF.
    I don't know where anyone got the idea you can't make a PDF from a Doc File.  Maybe in a future version That doesn't read doc. but for now

  • How to create tagged PDF using java iText

    Hi
    I want to create PDF for accessibility purpose using java and iText
    Please help.
    Thanks in advance

    i did this some yrs ago ..scratched and found some code for you. Have a look
    package com.oq.utility;
    import com.lowagie.text.Cell;
    import com.lowagie.text.Document;
    import com.lowagie.text.Element;
    import com.lowagie.text.Font;
    import com.lowagie.text.HeaderFooter;
    import com.lowagie.text.Image;
    import com.lowagie.text.PageSize;
    import com.lowagie.text.Phrase;
    import com.lowagie.text.Rectangle;
    import com.lowagie.text.Table;
    import com.lowagie.text.pdf.BaseFont;
    import com.lowagie.text.pdf.PdfWriter;
    import com.oq.model.Sale;
    import java.io.FileOutputStream;
    import java.util.ArrayList;
    import java.util.List;
    public class iTextExample
        public static void main (String[] args)
            iTextExample eg = new iTextExample();
            Sale sale = new Sale();
            sale.setOdrNumber("1");
            sale.setOdrDate("12-12-12");
            sale.setOdrCatCode("Örder");
            sale.setTotalInvValue("1234");
            sale.setRefNumber("in the line of fire");
            Sale sale1 = new Sale();
            sale1.setOdrNumber("1");
            sale1.setOdrDate("12-12-12");
            sale1.setOdrCatCode("Örder");
            sale1.setTotalInvValue("1234");
            sale1.setRefNumber("fire line");
            Sale sale2 = new Sale();
            sale2.setOdrNumber("1");
            sale2.setOdrDate("12-12-12");
            sale2.setOdrCatCode("Örder");
            sale2.setTotalInvValue("1234");
            sale2.setRefNumber("in the line of firel");
            List<Sale> list = new ArrayList<Sale>();
            list.add(sale);
            list.add(sale1);
            list.add(sale2);
            eg.printPDF(list);
        public void printPDF(List list) {
            Document document = new Document(PageSize.A4, 50, 50, 50, 50);
            try
                // creation of the different writers
                PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("iTextExample.pdf"));
                // various fonts
                BaseFont bf_helv = BaseFont.createFont(BaseFont.HELVETICA, "Cp1252", false);
                BaseFont bf_times = BaseFont.createFont(BaseFont.TIMES_ROMAN, "Cp1252", false);
                BaseFont bf_courier = BaseFont.createFont(BaseFont.COURIER, "Cp1252", false);
                BaseFont bf_symbol = BaseFont.createFont(BaseFont.TIMES_ROMAN, "Cp1252", false);
                // headers and footers must be added before the document is opened
                HeaderFooter footer = new HeaderFooter(
                            new Phrase("This is page: ", new Font(bf_courier)), true);
                footer.setBorder(Rectangle.NO_BORDER);
                footer.setAlignment(Element.ALIGN_CENTER);
                document.setFooter(footer);
                HeaderFooter header = new HeaderFooter(
                            new Phrase("This is a header without a page number", new Font(bf_symbol)), false);
                header.setAlignment(Element.ALIGN_CENTER);
                document.setHeader(header);
                document.open();
                Image img = Image.getInstance("arrow-ff.gif");
                img.setAlignment(Image.RIGHT | Image.TEXTWRAP);
                Table goodTable = new Table(2);     
                      Cell cell1 = new Cell(img);
                goodTable.addCell(cell1);
                document.add(goodTable);
                Cell c = new Cell("Header");
                c.setHeader(true);
                goodTable.addCell(c);
                Cell c1 = new Cell("Header1");
                c1.setHeader(true);
                goodTable.addCell(c1);
                Cell c2 = new Cell("Header2");
                c2.setHeader(true);
                goodTable.addCell(c2);
                goodTable.endHeaders();
                int j=0;
                          while (j< list.size())
                              Sale sale = (Sale)list.get(j);
                              c = new Cell(sale.getOdrDate());
                              goodTable.addCell(c);
                              goodTable.addCell(sale.getRefNumber());
                             j++;
                document.add(goodTable);
                // add text at an absolute position
                document.close();
            } catch (Exception ex) {
                System.err.println(ex.getMessage());
        }

  • .doc to pdf using jakarta tomcat POI

    Hi
    I need to convert my test.doc file in to
    test.pdf.I found a API jakarta tomcat POI project handling file systems
    1) is it possible to do that?(test.doc convert to test.pdf)
    2) do i have to use POIFS API or HSSF API HPSF API?which API
    3) do i have to use a jar file which i can add to class path?
    4) Is there place where i can see a simple example for file type convertion
    Thanks
    Suda

    Asking the same question in the same way with a different subject will not get it
    answered any faster...
    http://forum.java.sun.com/thread.jsp?forum=31&thread=330932&tstart=0&trange=15
    As a matter of fact, I HATE when people do that....
    If anyone knew the answer and wanted to get the duke dollars (if any)
    (suggest you offer some)
    then they would answer... the FIRST time.
    The answer to your question seems to be:
    1) DO SOME RESEARCH!
    2) RTFM!
    3) WRITE SOME TESTS
    4) READ/STUDY THE API

  • Generating pdf using java..

    hi everybody!
    is there any API that could be used to generate PDF,WORD docs from java. For WORD, there is some API JACOB, but for some reason it won't work for me.
    suggestions and code samples are highly appreciated.
    thanks in advance,
    /rahul

    I have successfull used FOP API
    http://xml.apache.org/fop
    DS.

  • Hyperlinks missing after converting Word 03 docs to PDF using Acrobat Pro 9.

    I'm having an issue when I convert a Word 2003 doc using Adobe Acrobat Pro 9 to pdf that the hyperlinks are disappearing.  I've had success with this in the past but for some reason now the hyperlinks never carry over or show up in the pdf.  I also have a good amount of bookmarks making up a table of contents within my word doc that aren't making the conversion either.
    I've spent a few hours thumbing through options in both the pdf printer and word as well as searching online with no luck.
    Kind regards,
    Tim

    Alright, I've got link creation process working again.
    However, now I have another technical issue with how the links are being handled.
    My work has an Intranet site that these Polices and Procedures are being accessed from (http://is-intranet/policiesandprocedures/).  For some reason when you open one of these forms on our Intranet site and click one of the embedded links (that are linking to another one of the Policy and Procedure PDFs) it's adding extra text to the path. i.e. open 2.01 Employee Handbook when I click a link embedded in that form to http://is-intranet/policiesandprocedures/3.01 Technology Usage Policy it's adding an extra is-intranet to the beginning of the path http://is-intranet/is-intranet/policiesandprocedures/3.01 Technology Usage Policy causing it to not open.
    I cannot seem to prevent this from happening.  Now, if I go through the form and look at the link it's correct and if re-link it to the other form everything works fine and the path of the link in the PDF doesn't change.  But now the link works correctly when opening the forms from our Intranet Site.
    It's a very confusing issue.

  • Convert .txt file to .pdf using java code

    Hi,
    My requirement is to read the .txt file and convert it into .pdf file after changing certain text.
    Searched the net got a document on iText ..is it the only way for conversion or any other method....please help.
    Thanks in advance.
    Pooja

    Hi.
    You could review this [url|http://www.roseindia.net/java/java-conversion/TextToPDF.shtml].
    It is a good example to use the iText Library.
    The other option could be [PDFBox|http://pdfbox.apache.org/].
    Here some [example code|http://pdfbox.apache.org/userguide/cookbook/creation.html#HelloWorld].
    Another option, but more complicated is [Apache FOP|http://xmlgraphics.apache.org/fop/].
    I hope you can find the right solution.
    Kindest regards, have a great day

  • Problem displaying Arabic characters in PDF using Java APIs

    We are experiencing a problem when attempting to display Arabic characters within a PDF document using the Java APIs.
    The relevant Java code is as follows:
    RTFProcessor processor = new RTFProcessor("example.rtf" );
    processor.setOutput( “example.xsl” );
    processor.setExtractXLIFF(true);
    processor.process();
    ByteArrayOutputStream dataOut = new ByteArrayOutputStream();
    DataProcessor dataProcessor = new DataProcessor();
    dataProcessor.setDataTemplate( example.xdt" );
    if( parameterValues != null && parameterValues.length > 0 )
    setReportParameters( dataProcessor, parameterValues ); // method to set any report parameters from the parameterValues list.
    dataProcessor.setConnection( jdbcConnection );
    dataProcessor.setOutput(dataOut);
    dataProcessor.processData();
    FOProcessor foProcessor = new FOProcessor();
    foProcessor.setLocale( locale );
    foProcessor.setData( new ByteArrayInputStream( dataOut.toByteArray() ) );
    foProcessor.setTemplate( “example.xsl” );
    String xliffFileNameAndPath = getXLIFFFile( “example”, locale );
    if( xliffFileNameAndPath != null )
    foProcessor.setXLIFF( xliffFileNameAndPath );
    foProcessor.setOutput( "example.pdf" );
    foProcessor.setOutputFormat(
    outputFormat == PDF_FORMAT ? FOProcessor.FORMAT_PDF : FOProcessor.FORMAT_HTML );
    foProcessor.generate();
    The method getXLIFFFile( ) gets the relevant XLIFF file for the supplied report locale (if it exists) – the three test files that we used were Italian (example_it_IT.xlf), Spanish (example_es_ES.xlf) and Arabic (example_ar_AE.xlf).
    I imported the following JAR files from the XML Publisher release (version 5.6.2) into my Java application: collections.jar, i18nAPI_v3.jar, versioninfo.jar, xdocore.jar and xmlparserv2.jar.
    The output is OK for all three translations in HTML format, using a charset of UTF-8, and for Italian and Spanish in PDF format. However, the Arabic characters display as question marks in PDF format. The same issue occurs if I stream the output as a byte array straight to the HTTP response rather than save within a file.
    Note that the same RTF, XDT and XLIFF files produce the correct output in both HTML and PDF when executed within XMLPublisher.
    Thank you

    Hi
    I had a similar issue with arabic chars. With PDF layout, chars were appearing properly when preveiwd on local m/c, but as I implement file on server, it was displayed as ?????. I had raised a TAR 5798348.993 with oracle about this and they suggested to apply patch 4028294 Oracle Sourcing J Rollup and then patch 4182914. But later my users changed requirement and i cud not apply the patch to test if it works fine.
    But here, you have suggested that installing fonts would do. Is it really that simple? If yes, dont know what is that patch for which I was told to apply.
    Regards
    Varun

  • Input xml file to crystal report and output  pdf  using java

    Hi all,
    I am in need, I am trying to give the input as dynamic extended Markup Language      and output to be Plain Document Format file, in my crystal report using simple java code. If possible can anyone drop a sample code. that would be great.

    Hi Naveen,
    If i have understood your requirement from your last post. this code should solve your problem.
    What i understand is you want to export a report to PDF format and this report is using XML file data.
    The below code Uses a report designed in Crystal report XI R2.
    Its a Standalone application which uses a Dataset made using the xmldata(xml file) and the xmlschema(xsd file).
    This Dataset is used to populate the report with data.
    Eventually the report is exported to a physical location at the end of this code.
    import com.crystaldecisions.ReportViewer.*;
    import com.crystaldecisions.reports.sdk.*;
    import com.crystaldecisions.sdk.occa.report.reportsource.*;
    import com.crystaldecisions.sdk.occa.report.exportoptions.*;
    import com.crystaldecisions.sdk.occa.report.data.IXMLDataSet;
    import com.crystaldecisions.sdk.occa.report.lib.IByteArray;
    import java.io.*;
    public class XMLData
         public static void main(String[] args)
              final String RPT_NAME = "XMLReport.rpt";
              try
                   ReportClientDocument rpt = new ReportClientDocument();
                   rpt.open(RPT_NAME, 0);
                   FileInputStream fin = new FileInputStream("C:
    Thick_client
    Amol_Sir
    Amol.xsd");
                     ByteArrayOutputStream baos = new ByteArrayOutputStream();
                     byte[] bytes = new byte[1024];
                     for(;;)
                            int count = fin.read(bytes);
                            if(count < 0)
                            break;
                              baos.write(bytes, 0, count);
                    final byte[] xsdBytes = baos.toByteArray();
                    fin.close();
                    //read xml file
                    fin = new FileInputStream("C:
    Thick_client
    Amol_Sir
    Abhi.xml");
                     baos = new ByteArrayOutputStream();
                     bytes = new byte[1024];
                     for(;;)
                            int count = fin.read(bytes);
                                if(count < 0)
                            break;
                                 baos.write(bytes, 0, count);
                   final byte[] xmlBytes = baos.toByteArray();
                   fin.close();
                   IXMLDataSet xml_ds = new IXMLDataSet()
    private IByteArray xmlData = null;
    public void setXMLData(IByteArray xmlData) {
    this.xmlData = xmlData;
    public IByteArray getXMLData() {
    return this.xmlData;
    private IByteArray xmlSchema = null;
    public void setXMLSchema(IByteArray xmlSchema){
    this.xmlSchema = xmlSchema;
    public IByteArray getXMLSchema() {
    return this.xmlSchema;
         xml_ds.setXMLData(new IByteArray() {
         public void fromString(String arrayValue){}
         public String toString() { return ""; }
         public byte[] getBytes() { return xmlBytes; }
         xml_ds.setXMLSchema(new IByteArray() {
         public void fromString(String arrayValue){}
         public String toString() { return ""; }
         public byte[] getBytes() { return xsdBytes; }
    rpt.getDatabaseController().setDataSource(xml_ds, "books/book", "books/book");
    ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)rpt.getPrintOutputController().export(ReportExportFormat.PDF);
    rpt.close();
    byte byteArray[] = new byte[byteArrayInputStream.available()];
    //Create a new file that will contain the exported result.
                   File file = new File("C:
    Thick_client
    Copy of Amol_Sir
    ExportedReport.pdf");
                   FileOutputStream fileOutputStream = new FileOutputStream(file);
                   ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(byteArrayInputStream.available());
                   int x = byteArrayInputStream.read(byteArray, 0, byteArrayInputStream.available());
                   byteArrayOutputStream.write(byteArray, 0, x);
                   byteArrayOutputStream.writeTo(fileOutputStream);
                   //Close streams.
                   byteArrayInputStream.close();
                   byteArrayOutputStream.close();
                   fileOutputStream.close();
                   System.out.println("Successfully exported report");
              catch (Exception exception)
                   System.out.println(exception.toString());

Maybe you are looking for

  • Can't boot from windows 7 usb installation media

    When trying to boot from windows 7 usb installation media no efi boot option availiable. Using "boot from efi file" option whith each and every .efi file on installation media results in a message saying "The selected boot device failed. Press <Enter

  • Need to run a report from monday to today

    Hi, I'm writing sql to run a report based on post date. It is to be hard-coded so that it runs every monday of the current week to today, and I am a bit weak in this area, any help would be appreciated, thanks!

  • LSMW & Internal Table

    All, I  using LSMW  (RMDATIND) to load material masters. IM using GUI upload to read the data into an internal table. The data reads in fine. Prioblem I have is when i map the internal table to the fields within each of the segments i only get the fi

  • Display Setting Problem

    I accidentally chose an unsupported display. If I boot the mini it starts up and then the display flashes "no support." If I start up in safe mode everything is very large. I go to system preferences and there is not a display selection. Is there a w

  • HT4993 How can I retrieve my deleted Text messages

    How can I retrieve my deleted text messages?