Rendering HTML to PDF Document?

Hey all, I really didn't know the correct place to post this but here goes:
I need to be able to issue an HTTP Request through Java, and what comes back is going to be HTML with JavaScript embedded. Okay, that's easy, done. Now I need to take that HTML content, render it like it would in a browser and create a PDF of the result. This is a J2EE Application, so I can't use Swing for the presentation (at least I don't think I can).
I'm not even sure if this is possible in Java (or practical). Any advice, libraries, open source packages, or anything I should look at? Is there a better forum here to try this question?

java_2006 wrote:
hi,
[everything is possible in java|http://itextpdf.com/] .
sadly iText is poorly documented, constantly changing things like package names, unstable, and uses a weird license.
Currently stuck trying to get it to work myself, after inheriting a bunch of sourcecode from a colleague who left the company before he could complete or document it.

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

  • Is it possible to stream video into a PDF document with HTML 5?

    I'm trying to get around using flash to stream videos into my interactive PDF documents, as it's not supported on iOS. I'm wondering if there's a way to use HTML 5 to acomplish something similar. I have access to both InDesign CC and the latest version of Adobe Acrobat Pro.

    An alternative is to separate the quiz pages to a separate document and include it in the main PDF as a file attachment. You can create links in the main document to the attachment so that it opens in a new window. When this quiz document is closed, the main document will be open.

  • Rendering pdf document properly in JSP

    I am currently working on a Portal project, which requires generating a PDF file and passing this to a JSP file providing an option to the user to either view the PDF file or download and save it. I've accomplished the first part of file creation (I am using iText for generating the pdf document), but I�m unable to send the file from server to the client side (ie to the browser).
    The code
    response.setContentType("application/pdf");
    response.setHeader("Content-Disposition", "inline; filename=file.pdf");
    which works perfectly fine when used as a standalone to popup an PDF file in tomcat server but fails to accomplish to render the outputstream properly(the stream is rendered in the JSP page improperly as text instead of associating with the application for reading pdf document�s) in the Portal Server Environment. Can anyone throw some light into this problem?

    The code is in JSP.
    What is the difference in putting the code in JSP or servlet.
    How is it working in standalone mode in tomcat application server.

  • Safari 7.0.6, using Adobe Acrobat 11.0.10, aren't rendering pdf files in the Print Preview screen.  Additionally, only a single, blank page prints for a multi-page pdf document.  Any ideas?

    Safari 7.0.6, using Adobe Acrobat 11.0.10, isn't rendering pdf files in the Print Preview screen.  Additionally, only a single, blank page prints for a multi-page pdf document.  Any ideas?

    Figured it out.  It had nothing to do with the software levels of Safari or Adobe Acrobat.  Here's the fix:
    Open Finder/Applications
    Search "Internet Plug-Ins"
    Move any Adobe plug-ins to the trash
    Quit Safari
    Launch Safari
    Your pdf document should now render in Print Preview and print properly.

  • Hyperlink from an HTML page directly to an artikle in a pdf document ?

    Hi,
    we would like to set a direct link from a HTML page to a special article in a pdf document. For the moment we could open the pdf document only at its first page.
    Thank you for your help :-)

    Hi,
    it's me again.
    Well, with the PDF open parameters I am now able to open a pdf document via HTML on a specific page number.
    (http://example.org/doc.pdf#page=10)
    However page numbers are changing so I want do define a special Article using the following command:
    http://example.org/doc.pdf#nameddest=Article16
    but the pdf opens always at the first page. Is there something to do in the pdf document with Article 16 first ?
    Regards Krokah

  • All my pdf documents have turned into firefox html documents and will not open correctly

    All my pdf documents have suddenly become firefox html docs & will not open unless I go into the folder, right click, 'open with', etc. I haven't changed any of my settings. I think firefox did an update yesterday, however, so I'm connecting it with that, possibly...

    Try this:
    # Right click your PDFs, click Properties
    # Go to the General tab
    # In the '''Opens with''' section, click the ''Change'' button
    # Select Adobe Reader (or Foxit Reader/Whatever PDF viewer you use)
    # Click Apply then OK.
    Does it work then?

  • Send word or pdf document as HTML email

    Hello all,
    we have word documents (on a local file) that we want to send via SAP as HTML email, i.e. we need the content of the word document in the email body. The documents also contain images. With the class cl_bcs I can send mails including attachments and also pure HTML but I don't know how to convert the word or pdf document into HTML and how to process it to get the images in the correct way. Is there perhaps a more direct way to achieve the goal to mail the word documents? Is there anybody who can help?
    Thank you very much and best regards
    Frank

    First, as you guessed, most (all?) mail clients don't display "complex" documents (doc, xls, pdf, etc.) inside a mail, they are always provided as attachments. Only simple documents like images can be directly displayed.
    SAP's job is not to convert from a format to another, especially .DOC and .PDF formats, which are rather complex.
    You'd better look at specialized third-party softwares. Note that SAP has a connection tool called BC-XDC (eXternal Document Converter) which is used to connect these third-party softwares to SAP. You may look at the certified softwares using this connection tool.
    Notes: if the .DOC and .PDF documents are generated by one of your programs, prefer to modify them to generate the documents in another format (HTML) instead of converting them. I can't say much as I don't know your exact scenario.
    There is also SO_RTF_TO_HTM (and CONVERT_TEXT maybe) function module, but I wouldn't expect much of it.

  • Display word/pdf document in the HTML region or report

    Hi,
    How to display blob content stored in a table in HTML region or report region.
    I already have a process to display the image content.
    But my question here is how to display word/pdf document within the html region so that the user can read the document without downloading it.
    Any suggestions/solutions would be of great help.
    Thanks in advance...
    Thanks,
    Ramesh P.

    I was dead wrong.
    The display of images from BLOB is a special case because APEX provides a Display Image item type.
    Moreover, HTP/HTF packages also do not provide for handling of BLOB content. So AJAX cannot be used.
    Which implies that the only way to get binary content, other than images, is with the use of a WPG_DOCLOAD.DOWNLOAD_FILE call.
    This in turn implies that it may not be feasible to "inject" the BLOB into an exist HTML DOM in the Browser.
    Regards,

  • Embedding pdf documents in HTML

    Hi everyone,
    I am working on a project where I need to embed some previously created pdf files into a web page. I am using object method and seems to be working in general, but having some issues while printing.
    First issue: In Firefox and IE, the embedded pdf object is not printing. There is a blank area where the document needs to be. I am thinking it's an Adobe Reader plug-in issue. Is there a setting that disables printing that object? In Chrome, the printing is complete- guessing Chrome has its own pdf viewer plugin.
    Second issue: Part of my project is to be able to add two or three lines of text as a header to these pdf documents. When I embed this pdf object, I am trying to scale down, so that there is room to add that header. But the scaling affects the quality of the printout. Do you have any recommendations on how to add header to the embedded pdf in HTML?
    Thank you,
    G

    yes, you just need to bundle your classes in a .jar
    file, and there is like an <embed> tag or something
    that lets you tell the html which class has the
    main() method, and it runs it fine. I did it a while
    a go so i know you can do it.
    Thanx a lot.. I know it is a stupid question but i have never worked with .jar files before can u tell me how to put my classes in one?

  • Advert resolution in PDF documents

    We are preparing a quarterly report in InDesign that will be distributed in PDF format. Right now we are toying with the idea of taking small "banner-like" advertisements. What resolution would be appropriate for ads and what formats should we prioritize?

    The content within a PDF document page is entirely up to the author - if it's a print layout, style the ads for print. If they're interactive, embed them as Flash annotations. The AIB rules for HTML-embedded ads don't apply.
    If you're referring to the "Ads for Adobe PDF" program, that closed in Jan 2009 and rendering of Sponsored Content is no longer supported by the Acrobat Family.

  • Using PD4ML library for convertin HTML to PDF

    Hi all
    i am using API s from PD4ML library for converting HTML to PDF.
    what i am sending via HTML is a single HTML table.but the problem is i need to identify the number of lines which i need to give for single PDF page for the case when HTML table is too large to fit into single page.i can decide the number of lines before hand like 31 for portrait and 52 for landscape.but in this case problem arises when page size is too large.for eg page size is A1 and i have specified number of lines as 31.
    In this case lot of empty space is left at the end of page.
    so i actually need to calculate NUMBER OF LINES for single page as a FUNCTION of PAGE SIZE and FONT SIZE . font size because it also affects the number of lines that fit into single page.
    would be really grateful if u guys can help fast

    #1 There are definite copyright issues with your
    software. Before you go live with anything like this,
    make sure you're not gonna get reamed.Ehh? I didn't see anything from the OP's question that implied this. Yes, if he uses it to mine commercial web sites and convert them to PDF's there's a problem, but aside from that, where's the danger?
    #2 The PDF part is the easy part. As the other poster
    said, lowagie iText can do PDF. The rendered HTML is
    a much bigger question. The smaller issue is that web
    pages are defined to fit your browser window, so
    you've got to choose a size. The much tougher problem
    is finding a decent HTML renderer in Java. In truth,
    I don't think there is one; JEditorPane is a piece of
    ****, and opera is really not a lot better. Not at all. The OP specifically mentioned web services, so we don't need to assume that Swing is involved. You can, using a 3rd party library (google for java pdf), have a servlet or jsp render its output as a PDF document.

  • Solutions for converting HTML to PDF programatically?

    to start off i should say that i am rather new to programming in java.
    here's what i am attempting to do.
    i need to write a java class that will get an HTML string as input... and needs to spit out a PDF file (or outputstream) as output. i have spent the last week or trying to accomplish this using XSL-FO and the FOP library. this solution does not work too well because XSL-FO and FOP do not handle complex table layouts very well (since they require the number of columns and column widths to be known in advance). it seems that FOP (and XSL-FO) is better suited to handling structured XML input... not something unstructured and complex as HTML.
    are there any other libraries/APIs that are out there that are specifically well suited to HTML -> PDF conversion?
    remember this needs to be done programatically, and will probably be invoked as a webservice.
    thanks,
    vivek

    #1 There are definite copyright issues with your
    software. Before you go live with anything like this,
    make sure you're not gonna get reamed.Ehh? I didn't see anything from the OP's question that implied this. Yes, if he uses it to mine commercial web sites and convert them to PDF's there's a problem, but aside from that, where's the danger?
    #2 The PDF part is the easy part. As the other poster
    said, lowagie iText can do PDF. The rendered HTML is
    a much bigger question. The smaller issue is that web
    pages are defined to fit your browser window, so
    you've got to choose a size. The much tougher problem
    is finding a decent HTML renderer in Java. In truth,
    I don't think there is one; JEditorPane is a piece of
    ****, and opera is really not a lot better. Not at all. The OP specifically mentioned web services, so we don't need to assume that Swing is involved. You can, using a 3rd party library (google for java pdf), have a servlet or jsp render its output as a PDF document.

  • Converting HTML into PDF

    Hello ABAP Experts,
    I have a request to convert a HTML Response (FM: HTTP2_GET) into a PDF Document.
    Has any body an idea how to handle that.
    Thank you very much for you answers.
    Kind regards
    Axel

    The easiest way to convert web pages/sites into PDF is with Acrobat! Important: this is Acrobat (costs a few dollars) and not Acrobat Reader!
    Acrobat has a web capture tool. With the older version I tested there was some minor problems.
    (1) It is not recognized as a browser we support. You will have to knock out the browser checking for this to work. Look at the cl_htmlb_content->runtime_validation. The last case statement. Modify your system to temporarily comment this out. (Do not forget to place it back!).
    (2) The older version I tested with had problems to convert complex pages into PDF. The new rendering we use is to browser specific. Your milage might vary.
    Alternative could be just to "print" the page from the browser into a PDFWriter (kind of printer driver that comes with Acrobat). This actually worked very well.
    Alternative is just to make screenshots into word document and convert this into PDF.
    > Please help me ..
    With this, I think we have now helped you. In return, you can help us with a nice append (or better a small weblog) about the "huge project that was a challange". These war stories shared by the fire side makes for interesting reading, and I am sure other people would also be interested in seeing what you achieved. Looking forward to it.
    ++bcm

  • 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.

Maybe you are looking for

  • EDI validation Error: Segment GS(Functional Group Header) at guideline

    Hi, I am working on EDI 272 transaction(inbound). I created ECS file for EDI 272 and validated the EDI 272 data with ECS file in the B2B document editor. Validation was sucess in the B2B document editor when I upload the same ECS file and tested the

  • A question about sendmail on solaris(10 and 11)

    I have a private network for working,all machines are linux or unix. I have one smtp server running postfix,wich force all connection to make tls(escuse my english relly bad). On hpux 11.31 i use this .mc divert(0)dnl VERSIONID(`$Id: generic-hpux10.m

  • Downpayment + Delivery Billing

    Can anyone advise if we can a order item that can trigger downpayment request and subsequently used for delivery related billing? Thanks Peter

  • Lost mozilla symbol on startup.Can'tgo to website. HELP

    the symbol on the startup,that you click to go to the website is suddenly gone and I can't figure out how to get the symbol back.Thanks for any help

  • Business One SDN improvement suggestions

    put the forum link back on the Developer Areas> Business One home page post the CHM help files for the DI-API 2004 version (not 6.5 that is ancient history now right?) get rid of the PDF files, i don't want to load a 30 meg 3rd party program to read