Generate PDF From Rendered Web Page (HTML and Flash)

Question: I am trying to generate a PDF from a web page (or series of web pages). The pages contain, not only HTML/JavaScript, but also Flash images (graphs/charts/etc). I have been searching diligently for a library (.PHP), but I have still to come up with something that works. (Note: I did find Winnovative's solution, but that has a different problem.) The killer for all these apps tends to be Flash requirement. The library can be FOSS/purchased/etc - I'm open to all suggestions at the moment. Again, the Flash is what is causing the most problems, hoping there is a solution on VeryPDF.

Answer: When you need to create PDF from HTML file with JavaScript and Flash images by some library from PHP code, maybe you can have a free trial of this software VeryPDF Doc Converter COM, by which you can create PDF from HTML from PHP code or other programming languages like VB, VC, Delphi, Power Build, Java, .NET, etc. This is Windows application, for now it can not be used under other system. When use this software, please make sure you have the following applications installed:PDFcamp Pro V1.8 or newer, Microsoft Windows 2000, or later versions, Windows Internet Explorer 5.0 or newer. Please check more information of this software on homepage, in the following part, I will show you how to use it in brief steps.

Step 1. Download Doc Converter COM

  • Please download and install PDFcamp Printer v2.3  and DocConverter COM from our website.
  • Please unzip "doc2pdf_com_trial.zip" package to a folder, and run "install_as_exe.bat" file to install the DocConverter COM into your system, then you can run HTML2PDF.exe from MS Dos Windows.

Step 2. Create PDF from HTML with JavaScript and Flash images.

  • When you need to create PDF from HTML  with JavaScript and Flash images, please refer to the following example:
    "html2pdf.exe" "C:/javascript_test.htm" "C:/output.pdf" "EnableSupportApplet=yes,DelayTimeForPrintApplet=10000"
    Please note when converting this kind of HTML file, you need wait more than 10000 millisecond before convert such HTML files). By the above example, you can created PDF from this kind HTML file without any problem.
  •         Create PDF file,
        For Example,
            Set PdfCreator = New PDFOUTLib.PdfCreator
            PdfCreator.HTML2PDF = "C:\sample.html"
            PdfCreator.FileName = "C:\sample.pdf"
            PdfCreator.HeadersFooters = "off"
            PdfCreator.paperType = 6 '//7 is A4 paper, 6 is A3 paper
            PdfCreator.CreatePDF
            While PdfCreator.StillRunning = 1
                DoEvents
                Call WaitMessage
            Wend
            Set PdfCreator = Nothing
            Debug.Print "C:\sample.html -->C:\sample.pdf"

  • When you need to run the conversion from PHP code, please refer to the following code template:
  • ?>
    Example:
                    <?php
                            $url = "http://www.verypdf.com";
                            $path = "C:\\test.pdf";
                            $com = new COM("PdfOut.PdfCreator");
                            $com->Doc2PDFCommandLine("\"$url\" \"$path\" \"paperType=0,PrintHTMLBackground=yes,overwrite=yes\"");

By this COM version library, we can create PDF from HTML with Flash images (graphs/charts/etc) without any problem. During the using, if you have any question, please contact us as soon as possible.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Random Posts

This entry was posted in DocConverter COM and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!