HTML to PDF convertion tool

Hi.
I need a tool which let me to convert HTML pages to PDF documents. It would be great If I could find a Java library for that (free or to pay for). Does anyone know something about this kind of tool? Once again: I'm intersted in HTML to PDF conversion NOT to create PDF from pure Java code.
Any help would be great...

I don't think that you'll find a native HTML to PDF converter for Java. If you want something windows based I think you can take the HTML to PDF converter library for .NET from http://www.dotnet-reporting.com or from http://www.winnovative-software.com and build a ASP.NET 2.0 web service that you can furher call from your Java application.
All the conversion can be done in a few lines for C# code:
       // Create the PDF converter. Optionally you can specify the virtual browser
        // width as parameter. 1024 pixels is default, 0 means autodetect
        PdfConverter pdfConverter = new PdfConverter();
        // set the license key
        pdfConverter.LicenseKey = "P38cBx6AWW7b9c81TjEGxnrazP+J7rOjs+9omJ3TUycauK+cLWdrITM5T59hdW5r";
        // set the converter options
        pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;
        pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal;
        pdfConverter.PdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Portrait;
        pdfConverter.PdfDocumentOptions.ShowHeader = false;
        pdfConverter.PdfDocumentOptions.ShowFooter = false;
        // set to generate selectable pdf or a pdf with embedded image
        pdfConverter.PdfDocumentOptions.GenerateSelectablePdf = selectablePDF;
        // Performs the conversion and get the pdf document bytes that you can further
        // save to a file or send as a browser response
        byte[] pdfBytes = pdfConverter.GetPdfFromUrlBytes(urlToConvert);

Similar Messages

  • HTML to PDF conversion tools?

    What are there good open-soucrce tools to convert HTML into PDF document?
    Thank you in advance.

    Here's a tutorial on setting up HTMLDOC for ColdFusion:
    http://tutorial135.easycfm.com
    Also the command line reference gives a good understanding on
    how the command line version works:
    http://www.easysw.com/htmldoc/docfiles/8-cmdref.html

  • HTML to PDF converter

    Hi All,
    Is there any tool which we can use with Coldfusion to generate the PDF's from HTML/webpage?
    I have seen many tool kit, when we want to convert a PDF from the webpage, we need to click "find" on the browser and select the tool , where the PDF will be created.
    Instead can we use some API of that and implement the same functionality ?
    All I need is a link or button in my webpage, when the user clicks on that, the PDF should be generated with the current page as the content.
    I hope my question is understood.
    Your help in highly appreciated.
    Thanks in advance!

    In your current pages (assuming they are cfm).
    <form action="makepdf.cfm">
    <input type="hidden" name="makeapdf" value="yes">
    <input type="hidden" name="desiredpage" value="#listgetat(script_name,listlen(script_name,"/"),"/")#">
    <cfset FormVariables = "">
    <cfif IsDefined("Fieldnames")>
        <cfloop index="variable" list="#Fieldnames#">
                      <cfif ListFind(FormVariables, variable) is 0>
                                              <cfoutput>
                                                                                <input type="hidden" name="#variable#"
                                                                                                         value="#evaluate('Form.#variable#')#">
                                                                 </cfoutput>
                 <cfset FormVariables = ListAppend(FormVariables, variable)>
               </cfif>
    </cfloop>
    </cfif>
    <input type="submit" value="Create as PDF">
    </form>
    <!--- and on makepdf.cfm --->
    <cfif isdefined("makeapdf")>
      <cfdocument  format="pdf"  pagetype="letter" pagewidth="8.5" pageheight="11">
    <cfinclude template="#desiredPage#">
        </cfdocument>
    </cfif>
    </body>
    </html>

  • HTML to PDF again

    I need that my users can save my JSPs to PDF without installing a pdf printer.
    Is there any way or tool to do that? i've been read about FOP and iText but i think that is very complicated. I don't care if i need to pay for a license

    I don't think that you'll find a native HTML to PDF converter for Java. If you want something windows based I think you can take the HTML to PDF converter library for .NET from http://www.dotnet-reporting.com or from http://www.winnovative-software.com and build a ASP.NET 2.0 web service that you can furher call from your Java application.
    All the conversion can be done in a few lines for C# code:
           // Create the PDF converter. Optionally you can specify the virtual browser
            // width as parameter. 1024 pixels is default, 0 means autodetect
            PdfConverter pdfConverter = new PdfConverter();
            // set the license key
            pdfConverter.LicenseKey = "P38cBx6AWW7b9c81TjEGxnrazP+J7rOjs+9omJ3TUycauK+cLWdrITM5T59hdW5r";
            // set the converter options
            pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;
            pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal;
            pdfConverter.PdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Portrait;
            pdfConverter.PdfDocumentOptions.ShowHeader = false;
            pdfConverter.PdfDocumentOptions.ShowFooter = false;
            // set to generate selectable pdf or a pdf with embedded image
            pdfConverter.PdfDocumentOptions.GenerateSelectablePdf = selectablePDF;
            // Performs the conversion and get the pdf document bytes that you can further
            // save to a file or send as a browser response
            byte[] pdfBytes = pdfConverter.GetPdfFromUrlBytes(urlToConvert);

  • How to convert HTML to PDF

    - runs on Linux, 2.4.24 Kernel.
    - We would like to be able convert the HTML report into a PDF file.
    - Ideally we would like to use open source code for the PDF generation
    We would like to be able to include both Text and Bitmaps in the PDF output
    Thanks!
    Message was edited by:
    dragontail77

    HTML to PDF with Java, using OpenOffice.org - example here: [http://www.dancrintea.ro/html-to-pdf/|http://www.dancrintea.ro/html-to-pdf/]
    You can use OpenOffice.org, running as a server and command it remotely for document convertion.
    Besides HTML to PDF, there are also possible other convertions:
    doc --> pdf, html, txt, rtf
    xls --> pdf, html, csv
    ppt --> pdf, swf
    Code example:
    import officetools.OfficeFile; // this is my tools package
    FileInputStream fis = new FileInputStream(new File("c:/test.html"));
    FileOutputStream fos = new FileOutputStream(new File("c:/test.pdf"));
    // suppose OpenOffice.org runs on localhost, port 8100
    OfficeFile f = new OfficeFile(fis,"localhost","8100", true);
    f.convert(fos,"pdf");
    -----------------------------------------------------------------------------------------------------------------------------------------

  • Trouble in fop(convert html 2 pdf) source.

    to convert html 2 pdf file I found the article from javaworld.
    (http://www.javaworld.com/javaworld/jw-04-2006/jw-0410-html.html)
    unfortunately I can't seem to find the two classes below even though import all fop 0.94 library files.
    are there something I'm missing?
    Thanks.
    import org.apache.fop.apps.Driver;
    import org.apache.fop.tools.DocumentInputSource;

    Much thanks for your timely reply.  The scanner software requires that one must scan to an application.  The configuration has to point to an executable.  In program files I must select an executable,  in this case acrobat.exe.   Have been using this for years and never have seen a problem.  Continues guidance sought.

  • Convert HTML to PDF or AFP

    As part of the project we have to convert html documents to PDF or AFP. We tried with different tools like HTMLDOC and we are not able to get the perfect matching tool. Any help on finding the best tool for conversion of HTML to PDF or AFP will be appreciated.
    My basic requirement is
    1) The conversion process needs to be automated
    2) the tool has to run on Linux.
    3) Everything in the page (text, image etc) should be extracted in a single file
    Background
    A batch job which runs on Q&R cache servers to run every evening. The job has a list of 1500 symbols which iterates through and does an http get of the Stock Summary page for each ticker in the list. The next step is to launch HTMLDOC or another tool to convert to PDF, APF, or other format.
    Regards,
    Jags.

    I'm not sure it'll help you, but take a look at
    http://xml.apache.org/fop/index.html
    maybe you can go this way
    XHTML->XML->FOP->PDF
    ???

  • Automate converting HTML to PDF

    Hi,
    I'm using my iPad to write documents using Byword that I export using HTML (export to PDF doesn't take account of HTML headers and rendering MathJax).
    Lets say that the text file therefore is called MathJax.txt and is in the location such that it's file path is Dropbox/Byword/MathJax.txt
    This HTML file is saved straight onto my Dropbox in the current location. (i.e. Dropbox/Byword/MathJax.html )
    If anyone can help, I'm looking for a way to convert the HTML to PDF with the MathJax rendered, either with cli, applescript or automator - just some way I can activate it with Hazel.
    I've seen wkhtmltopdf which looks like it would do the bit I'm missing, but I'm not very knowledgeable and have no idea how to use it.
    Any advice would be much appreciated!
    Freddie

    There is an app version in Google code…
    https://code.google.com/p/wkhtmltopdf/
    I downloaded it & opened it & it appeared to do nothing! However I also did right click > (or ctrl+click) Show Package contents… and navigated to Contents/MacOS/wkhtmltopdf. That is a compiled binary that will run in Terminal.
    To use the binary drop it into Terminal, and then drop your PDF into there (to enter the path) and then enter a file destination & name (ensuring a space after the PDF path).
    My command looked like…
    /Volumes/wkhtmltopdf/wkhtmltopdf.app/Contents/MacOS/wkhtmltopdf /Users/dru/Desktop/pdfroff\(1\)\ Mac\ OS\ X\ Manual\ Page.html /Users/dru/Desktop/test2.pdf
    The backslashes escape the spaces & other special characters, Terminal will deal with all that if you drag & drop to create the path. The hardest part is setting the destination - it's simplest to use an existing file & delete the end part & add a new name.
    Hit return & you get a PDF, I don't know if this covers MathJax formatting, I have never heard of that sorry.
    One good thing about this is that you can automate it with Automator, Hazel or a shell script etc.
    I expect you'll need further help so ask away.
    Frankly it is a little bit kludgy, you should really download the source & compile it, but that is rather involved.
    There are a few html to PDF apps, but they appear to be $20 up to several hundred & it isn't clear if they can automate the process.
    P.S. I tested this on my 10.6 system that has lots of tools installed, so I may have items that you don't, note any errors & I'll try to help, otherwise wait for a better idea.

  • How to convert html to pdf using acrobat sdk 8.0?

    hi
    I am a beginner of acrobat sdk .
    I want to know How to use acrobat sdk 8.0 to convert html to pdf?
    herere some questions :
    1:How to support navigation inside PDF file that generated using acrobat sdk 8.0? For example: theres catalog in the top of HTML file, customer hopes can navigate inside the PDF file just like navigating inside the HTML file.
    2:How to support operating some controls in the PDF file that generated using acrobat sdk 8.0? For example: therere some drop down list and text box in HTML file, customer hopes can input text in the text box, click the drop down list to see available options in it just like in HTML file.
    Thanks in advance for any help and suggestion.

    Hello,
    I want a system to re-brand my 37 pages PDF for affiliates.
    I want a php dynamic link in the PDF online in order to personalize automatically the PDF for each affiliate. I need to change 2 links each time. The affiliate ID and the Paypal email (payment button) in page 36.
    Can you help?
    Please let me know
    Thank you
    Alex
    PS My system is online and i can give you the url if it helps.

  • Problem with converting html to pdf using LiveCycle ES Java API

    I am using this code to convert html to pdf.
    * 1. adobe-generatepdf-client.jar
    * 2. adobe-livecycle-client.jar
    * 3. adobe-usermanager-client.jar
    * 4. adobe-utilities.jar
    * 5. wlclient.jar
    import java.io.File;
    import java.util.Properties;
    import com.adobe.idp.Document;
    import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
    import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;
    import com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient;
    import com.adobe.livecycle.generatepdf.client.HtmlToPdfResult;
    public class ConvertHTML {
       public static void main(String[] args)
            try{
            //Set connection properties required to invoke LiveCycle ES                             
            Properties connectionProps = new Properties();
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "t3://localhost:7001");
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,Service ClientFactoryProperties.DSC_EJB_PROTOCOL);       
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "WebLogic");
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
            //Create a ServiceClientFactory instance
            ServiceClientFactory factory = ServiceClientFactory.createInstance(connectionProps);
              //Create a GeneratePdfServiceClient object
            GeneratePdfServiceClient pdfGenClient = new GeneratePdfServiceClient(factory);
           //Get an HTML document to convert to a PDF document a
            String inputFileName = "http://www.adobe.com";
            //String inputFileName = "C:\\Documents and Settings\\venkat\\Desktop\\Adobe.htm";
            String securitySettings = "No Security";
            String fileTypeSettings = "Standard";
    System.out.println("one");
            //Convert HTML content to a PDF document
            HtmlToPdfResult result = pdfGenClient.htmlToPDF2(inputFileName, fileTypeSettings, securitySettings, null, null);
    System.out.println("two");         
            //Get the newly created document
            Document createdDocument = result.getCreatedDocument();
            //Save the PDF document as a PDF file
            createdDocument.copyToFile(new File("C:\\test.pdf"));
        catch (Exception e) {
            System.out.println("Error OCCURRED: " + e.getMessage());
            e.printStackTrace();
    I can able to compile this class but while running i am getting error like below.
    Error OCCURRED: Internal error.
    ALC-DSC-000-000: com.adobe.idp.dsc.DSCRuntimeException: Internal error.
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.doSend(EjbMessageDispatcher.java
    :160)
            at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispat
    cher.java:57)
            at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
            at com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient.htmlToPDF2(GeneratePdfSer
    viceClient.java:666)
            at ConvertHTML.main(ConvertHTML.java:84)
    Caused by: java.rmi.RemoteException: Remote EJBObject lookup failed for 'ejb/Invocation'; nested exc
    eption is:
            org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 203  completed: No
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(EjbMessageDispatcher.
    java:101)
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.doSend(EjbMessageDispatcher.java
    :130)
            ... 4 more
    Caused by: org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 203  completed: No
            at com.sun.corba.se.impl.logging.ORBUtilSystemException.writeErrorSend(Unknown Source)
            at com.sun.corba.se.impl.logging.ORBUtilSystemException.writeErrorSend(Unknown Source)
            at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.writeLock(Unknown Source)
            at com.sun.corba.se.impl.encoding.BufferManagerWriteStream.sendFragment(Unknown Source)
            at com.sun.corba.se.impl.encoding.BufferManagerWriteStream.sendMessage(Unknown Source)
            at com.sun.corba.se.impl.encoding.CDROutputObject.finishSendingMessage(Unknown Source)
            at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.finishSendingRequest(Unknown Sour
    ce)
            at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete1(Unkno
    wn Source)
            at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(Unknow
    n Source)
            at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(Unknown Source)
            at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.is_a(Unknown Source)
            at org.omg.CORBA.portable.ObjectImpl._is_a(Unknown Source)
            at weblogic.corba.j2ee.naming.Utils.narrowContext(Utils.java:126)
            at weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFact
    oryImpl.java:94)
            at weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFact
    oryImpl.java:31)
            at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:41)
            at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
            at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
            at javax.naming.InitialContext.init(Unknown Source)
            at javax.naming.InitialContext.<init>(Unknown Source)
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initJndiContext(EjbMessageDispat
    cher.java:213)
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.getJndiContext(EjbMessageDispatc
    her.java:226)
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(EjbMessageDispatcher.
    java:87)
            ... 5 more
    can u plz give me some way to do the convertion.

    Yes Sir.....Thanks for ur suggestion.....
    But i didn't find exact solution..well..yes i found some but not exactly there were not in the way i required...I jus need to convert HTML to PDF using iText API for java.....I already used some classes in that like HTMLParser.....etc..
    So Any thing else...Any one...Sure can help me in this................

  • Convert HTML to PDF - API or utility

    Hi community,
    Our product generates HTML reports, after that the users can edit them, and finally they want to send them via e-mail to another party. They want to send PDF document generated from that HTML. So I need to convert the HTML to PDF. Till now we did that with FOP and a xsl file we found(I don't remember where from) and improved a bit. However it becomes hard to maintain.
    Searching around the forum and Google I found out about HTMLDoc, but it is not appropriate because FAQ states that currently it cannot embed other fonts than preset ones, and I need cyrillic font support. I tried several virtual printers that print to PDF file, but I want to escape from the HTML look - like table borders, etc.
    I need a pointer to an appropriate product. Preferrably a pure java library, cross-platform because we will soon migrate from Windows to Linux, with support for external font embedding (like fop and iText). I am not limited to using only opensource and free libraries, it can be a commercial licence one.
    Please share your experience in this area and guide me to a good library
    Thanks for your time
    Mike

    Thanks for that idea ChuckBing. I will download OpenOffice and try this, it sounds good because OpenOffice seems to support both Linux and Windows.
    Unfortunately the adobe online solution turned out not to be applicable for our case since there are customers that don't have access to Internet, besides there was a note on the site that currently only US and Canada are supported(but maybe I read it wrong)??
    Thanks to all - kylias, MOD, DrClap and ChuckBing - for your participation. If OpenOffice does not solve the problem I intend to continue following the FOP path.
    Mike

  • Converting images as well as text from HTML to PDF

    I used Acrobat XI to convert a text and photo document I created in Squarespace (HTML) to PDF. Acrobat successfully retained the format of the document and all the text but left blank all the spaces where photos had been placed. I then had to re-import all the photos, re-size and re-caption them -- a lot of work! Is there a way for Acrobat to import the entire document as it displays on the web, including all the photos in their proper placement?

    Thanks for your suggestion. Where do I find the setting for View Large Images?

  • Acrobat 8 Professional - converting HTML to PDF

    Hi,
    I'm trying to convert a website from HTML to PDF but having problems with the directory structure. I want the new PDF version to have the same directory structure that the old HTML version has. If I can't have that, how can I impose the directory structure I want on the new PDF version ?
    thanks in advance.

    This is a major Pain in the A>>. I work in a virtual office and share a pretty high volume of PDF documents as software requirements, diagrams, etc. I almost never print to actual paper, the PDF driver was my default printer. I would hit Cmd-P, Return, print a file name, Return and presto a PDF. Now I have to mouse around and find the "save to PDF" option from some ridiculous nearly hidden list of options in a drop down button. There's no keystroke or shortcut that I can find that allows me to do this w/out mousing around.
    Sounds like Apple and Adobe ran out of time and the usability got left on the cutting room floor.
    BTW, I'm on Acrobat 8 still, so I don't even have the option to "Print to Adobe PDF" - AND if I print to landscape mode, the view isn't rotated, the document is "sitting on its side" in portrait -- very frustrating...

  • Is anybody programmatically converting HTML to PDF? If so, how?

    Is anybody programmatically converting HTML to PDF? If so, how?
    With InDesign, or something else?
    As long as the application (InDesign or something else) has a command-line interface, i'd like to know about it.
    Am using .NET, but we still want to know what you're doing even if you aren't.
    Source data is HTML pages from random sources, so it's not necessarily XHTML unfortunately, though i could tidy it into a consistent form.

    thanks, but what i'm looking for here is programmatic usage -- that is, scripted or command-line -- not having a human user choosing menu options, etc
    so as to your two suggestions ...
    this would appear to be NOT programmatic ...
    > And Acrobat will install a PDF convert toolbar for Internet Explorer to do this right from the browser.
    and this might or might not be possible to program -- i don't know if people are somehow running Acrobat programmatically, would appreciate further information
    > Acrobat has a Create PDF from Web Page function

  • Jar file for converting html to pdf

    Does anybody have jar file for converting a html document to pdf?

    Are u particular about using jar file ?
    I have developed form which converts any type of files especially word, txt ,html to pdf. Let me check if I have that
    Rajesh ALex

Maybe you are looking for

  • Problem to creating users in to Presence 9.1.

    Hello, Presence: 9.1.1.20000-5 The presence don't can creation the users, after reset of the presence go back functionality, but in log found the below errors: Line 24324: Nov 19 12:17:03, NLTDTC-UC-CUPPUB-01, Info,  jabberd, : b79acb90| info| base_c

  • Deskjet 940C carriage won't move

    I have an deskjet 940C. The ribbon cable that attaches to the carriage (thing that holds ink cartridges) has come loose. The carriage has moved to far right. I can not move the carriage to center to recommect the cable. How do I release the carriage

  • How to Snap

    Hi everyone, I am newbie here. Can someone please tell me how to snap such as the attached image? Please notify me by email when there is a reply. Thank you Jarlabs http://s11.postimage.org/eznfpmu83/Adobe_Illustrator.png

  • HT1409 why is my artwork tab disabled in iTunes

    Trying to add custom artowrk to album/song in iTunes but "get info" dialog bix has artworked disabled. is there a switch/button, whatever, i need to change? runing latest itunes and moutain lion.

  • APINV return back to the previous approver in the Approval sequence

    Dear All Some Invoice's return back to the previous approver in the Approval sequence although the previous approver has approved it. Issue has come abruptly No modifications or changes has been taken place. The Approver sequence has been already com