DynamicPDF 1.0
DynamicPDF 1.0 was used to provide this manual in PDF format here.



Description   Go to top   Purchase it

NEW: DynamicPDF 1.0 is now available as a web service.

DynamicPDF 1.0 is a great tag for those who want to generate PDF/PS/HTML files instantly from their ColdFusion application. You can generate PDF/PS/HTML files in many ways including:

  • You can supply static or dynamic text between the opening and closing DynamicPDF tags to convert this text into PDF/PS/HTML file. This is excellent for generating customized PDF/PS files for your customers by including their names, logo, and personal information. You can also loop through ColdFusion objects like LISTS, QUERIES, DIRECTORIES and generate dynamic text. It is also great for generating web pages to add to your web site.

  • You can use HTML (or any web language) to format your text enclosed within the opening and closing DynamicPDF tags!! That is right, you can format a page using tables, headers, text formatting (bold, italics), etc. and see the same result on your PDF/PS/HTML file. It is like you have a PDF, a PS editor and a web site editor together but for much cheaper and more flexible to use!

  • You can supply a name and path of a file. The tag will capture all the text in that file, and generate a PDF/PS/HTML with this text. This is excellent for demonstration purposes when a file or program needs to be converted into PDF/PS/HTML before executing the code inside the file.

  • You can use GET method to pull the source of a web page, and then have DynamicPDF 1.0 convert the page into PDF!


Legal Statement and Credits   Go to top   Purchase it

DynamicPDF 1.0 is developed, supported and maintained by Gilgamesh Solutions, Inc. It may not be re-distributed, re-sold, decrypted, or used without proper license, without the written consent of Gilgamesh Solutions, Inc. Support Team. The proper license should be purchased directly from Gilgamesh Solutions, Inc. at http://gilgamesh-solutions.com/products.cfm#p1.


Requirements   Go to top   Purchase it

- DynamicPDF 1.0 will run successfully on the following operating systems:
  • Windows 95 and later.
  • AIX.
  • Digital (Tru64) UNIX.
  • FreeBSD.
  • HP-UX.
  • IRIX.
  • Linux.
  • NetBSD.
  • OpenBSD.
  • Solaris (Intel or SPARC).
  • MacOS X.

- DynamicPDF 1.0 is written in CFMX 6.0. It will successfully run on ColdFusion 5.0+.

- DynamicPDF 1.0 will need HTMLDOC to generate PDF. A FREE download of htmldoc 1.8.23 is available from our web site for Windows systems. Binary downloads are available from http://www.easysw.com/htmldoc for other operating systems (subscription may be required).


Set Up Your Application   Go to top   Purchase it

To start using DynamicPDF 1.0, please follow the steps below:
  • Download HTMLDOC 1.8.23 (Windows: download from our web site. Other operating systems: download from http://www.easysw.com/htmldoc). All downloads from our web site are FREE.

  • Extract HTMLDOC 1.8.23 to any directory on your server. There are a few remarks regarding the directory of choice:

    1. The directory does not need to be under your web server root directory.

    2. You need to extract all the files and directories generated from HTMLDOC 1.8.23 in one directory. Do not attempt to move around individual files. All files and directories generated will be needed to communicate with DynamicPDF 1.0.

    3. You need to have execute permissions on the directory where you extracted HTMLDOC 1.8.23.


  • Extract DynamicPDF 1.0 from the ZIP file that came with your purchase. Please do not attempt to open the cfm file and re-save it. The file is encrypted, and if you try to re-save it after opening it, you will cause the file to corrupt. You can place the extracted file in your custom tag directory, or your current working directory.
You are now ready to generate PDF/PS/HTML files on the fly!


Troubleshoot Application Set Up   Go to top   Purchase it

It is always good to start out with a very simple example to see if the application is set up correctly. Please do not attempt to generate a very complex PDF report from the first try. Start out with a simple example first. Your simple example should have two parameters, MyDoc and PdfFile. MyDoc will point to ghtmldoc.exe file in the extracted HTMLDOC 1.8.23 directory as an absolute path (for example: c:\HTMLDOC\ghtmldoc.exe), and PdfFile will be the name of your generated PDF file. If this approach does not work to troubleshoot the issues with your application, try the following pointers:
  • I get an exception while trying to run my application for the first time.

    This could mean a few things:
    1. Did you remember to extract all HTMLDOC 1.8.23 files and folders in one directory? You should not try to move files around because HTMLDOC 1.8.23 will need all files and folders extracted to run successfully.

    2. Do you have execute permission on the directory where you have HTMLDOC 1.8.23? You should!

    3. Do you have CFFILE and CFEXECUTE tags permission? You can set those up by accessing your ColdFusion Administrator Interface (Usually under "Security", "Resource Security", then "CF Tags"). You have to enable the usage of both tags to be able to run DynamicPDF 1.0.


  • I am getting some encrypted code on my output page.

    This means that you opened DynamicPDF.cfm and tried to re-save it. This causes the file to corrupt. Please delete the copy you have, and re-download the original copy from your email, or extract it from the ZIP file you received from us after your purchase.

  • I am receiving a timeout error or exception.

    There is a parameter you can send to DynamicPDF 1.0 that is called TIMEOUT. This parameter sets the call timeout for communications between DynamicPDF 1.0 and HTMLDOC. It is 5 seconds by default. You can do one of the following two things to resolve this issue:

    1. You can either set TIMEOUT="n", where n is a large number in seconds. This will give DynamicPDF 1.0 plenty of time to communicate with HTMLDOC on generating your file. Please remember that you have to wait the n seconds before the page loads online.

    2. You can set TIMEOUT="0", this is an ideal solution for many clients. This will terminate the HTTP request to DynamicPDF 1.0. However, DynamicPDF 1.0 will still be communicating with HTMLDOC to work as a system process. Your file is being generated even though the page online stopped loading in front of your visitors.



Syntax   Go to top   Purchase it

The syntax to call DynamicPDF 1.0 is:

<CF_DynamicPDF

     myDOC ="D:/Inetpub/wwwroot/ghtmldoc.exe"
     timeout ="[your timeout in seconds]"
     inFile = "file carrying text to be included in your generated pdf"
     inFilePath = "path to file above"
     pdfFile = "test.pdf"
     pdfPath = "D:/documents"
     pdfOverwrite = "no"
     displayOutput = "no"
     options = ""
     delInFile = "yes"
     kill = "[y|n]"
     killPath = "kill program path"
     killArguments = "kill program arguments"
     relativePath = "[y|n] to include relative path">

     Optional text

</CF_DynamicPDF>

Explanation of the parameters:
  • myDOC: This is an absolute path to the ghtmldoc.exe file. You start with your drive all the way to your ghtmldoc.exe file. Please do not forget to include ghtmldoc.exe at the end (for example: C:\WebSites\HTMLDOC\ghtmldoc.exe).
  • timeout: This is the timeout in seconds. Your application call to DynamicPDF 1.0 will last for this many seconds. It is recommended to use (timeout="0") to run DynamicPDF 1.0 and HTMLDOC as a system process.
  • inFile: If you mention this parameter, you should not put any text between opening and closing DynamicPDF 1.0 tags. Basically you have two ways to supply DynamicPDF 1.0 with input text. You can either send DynamicPDF 1.0 an input file, this way you have to specify inFile and inFilePath (if inFile is not in the current directory). Or, you can just ignore both of those parameters, and supply dynamic text between opening and closing DynamicPDF 1.0 tags. If you supply inFile, DynamicPDF 1.0 will read the file and output its content to the generated PDF/PS/HTML file.
  • inFilePath: This is the absolute path to the inFile mentioned above.
  • pdfFile: This is the name of the PDF file to be generated.
  • pdfPath: The path to the PDF file that will be generated. If not specified, the PDF generated will be in the current directory.
  • displayOutput: If "Yes" or "Y", the same text that was converted to PDF will be displayed on the web page. This is good to show your users what they are about to see in PDF format. Default is "N".
  • options: You can send your formatting options here. Please refer to DynamicPDF 1.0 options page.
  • delInFile: If you decide to supply an input file to generate the PDF, you can set this parameter to "Yes" or "Y" to delete the original input file after the generation of the PDF document. If you decide to send the input as text between opening and closing DynamicPDF 1.0 tags, then DynamicPDF 1.0 will generate a page of the format "output_mm-dd-yy". DynamicPDF 1.0 will then use this intermediate step to format the text. The file output_mm-dd-yy will still be left on the server. You can set this parameter to "Yes" or "Y" to have DynamicPDF 1.0 delete this file after using it.
  • kill: We provided the ability to include a KILL utility to kill any HTMLDOC processes running in memory after the execution of DynamicPDF 1.0. Most of the time the processes terminate normally. However, a few times when your application throws an error, it might not terminate the processes successfully. You can use this parameter to kill those processes. You can use this parameter to run any KILL utility you have available on your server. "kill" accepts either "Y" or "N".
  • killPath: This is the path to your KILL utility. The path will include the name of the KILL utility.
  • killArguments: This is a space delimited of arguments that your KILL utility may accept.
  • relativePath: This parameter accepts "Y" or "N". It is set to "N" by default. If you use "Y", DynamicPDF 1.0 will expand your relative paths to absolute paths so HTMLDOC can find the images accordingly. We suggest that you do that in your code instead of depending on this parameter which may cause the code to run a little bit slower than usual.

Examples   Go to top   Purchase it

In this section, we are going to use a few examples that tend to be popular use of this great tool.
  • I want to generate a PDF with information queried from the database.

    <cfquery name="your_query" datasource="your_datasource">
    SELECT Salutation, FirstName, MiddleName, LastName, Email
    FROM Clients
    WHERE ID > 13434
    </cfquery>

    <CF_DynamicPDF

    myDoc="C:\websites\ghtmldoc.exe"
    pdfFile="test.pdf">

    <table border="1">
      <tr>
        <td>
          <strong>Salutation</strong>
        </td>
        <td>
          <strong>First Name</strong>
        </td>
        <td>
          <strong>Middle Name</strong>
        </td>
        <td>
          <strong>Last Name</strong>
        </td>
        <td>
          <strong>Email</strong>
        </td>
      </tr>

    <cfoutput query="your_query">
      <tr>
        <td>
          #Salutation#
        </td>
        <td>
          #FirstName#
        </td>
        <td>
          #MiddleName#
        </td>
        <td>
          #LastName#
        </td>
        <td>
          #Email#
        </td>
      </tr>

    </cfoutput>
    </table>
    </cf_DynamicPDF>

    This syntax will simply query the CLIENTS table and retrieve Salutation, First Name, Middle Name, Last Name, and Email for those who carry ID bigger than 13434. You can then use DynamicPDF 1.0 to print out those records to a PDF named test.pdf that will be created in the current directory.

  • I want to generate a PDF with my company's logo in the header of each page.

    <CF_DynamicPDF

    myDoc="C:\websites\ghtmldoc.exe"
    pdfFile="test.pdf"
    options="--header l --logoimage C:/inetpub/wwwroot/images/lincolnLogo.gif">

    This web site is a great source of information.

    </cf_DynamicPDF>

    This example above will generate a PDF named test.pdf in the current directory. The PDF will have an image called lincolnLogo.gif in the header of each page. Please notice how there are no quotes around the absolute path to the image.

  • I already have an HTML page. I want to convert it to PDF.

    You have a couple of options here:
    1. If your page is online and accessible via HTTP call, and you want to convert the result of your html formatted page, then you can use the following syntax:

      <cfhttp
      method="get"
      url="http://www.yourserver.com/directory1/yourpage.html"
      > </cfhttp>

      <CF_DynamicPDF

      myDoc="C:\websites\ghtmldoc.exe"
      pdfFile="test.pdf">

      <cfoutput>
          #cfhttp.FileContent#
      </cfoutput>

      </cf_DynamicPDF>

      This code above will pull the source of the web page above, and it will convert the retrieved text to PDF after executing the HTML tags.
    2. If your page is on the server and you want to access it through internal call and not online, then you can use the pre-built parameter inFile to convert its content to PDF. This will not execute HTML tags like the syntax above did.

      <CF_DynamicPDF

      myDoc="C:\websites\ghtmldoc.exe"
      inFile="myhtmlfile.html"
      inFilePath="C:\websites\html\"
      pdfFile="test.pdf">

      </cf_DynamicPDF>


  • I want the page to not load until the PDF is created. Then, I want the page to load in front of my user with a link to download that PDF.

    <CF_DynamicPDF

    myDoc="C:\websites\ghtmldoc.exe"
    pdfFile="test.pdf"
    pdfPath="C:\Inetpub\wwwroot\itdata\pdf\">

    The page will not load until the PDF is generated and the link is available for download.

    </cf_DynamicPDF>

    <cfloop condition="true">

      <cftry>
        <cffile
        action="READ"
        file="C:\Inetpub\wwwroot\itdata\pdf\test.pdf"
        variable="testvar"
    >

        Your generated file can be found <a href="javascript:void(0);" onClick="window.open('yourpdf', 'PDF', 'width=1000,height=800,menu=no,scrollbars=yes');>here< /a>.

        <cfbreak>
      <cfcatch type="any">
      </cfcatch>
      </cftry>

    </cfloop>

    When the page that has the syntax above is accessed, it will keep loading until the PDF is generated with the text "The page will not load until the PDF is generated and the link is available for download." Once the PDF is generated, the CFFILE will find it, and it will display the link for the user to click on to view this generated PDF. This approach is ideal for almost all clients because the loading of the page will take as long as necessary until the PDF is generated. The user will not see the link until the file is actually fully generated.

    Please note that in the CFLOOP above, many actions can be taken when the file is generated. Instead of displaying the link to the user, you can actually email, ftp, move around, or display the actual file generated. All you have to do is add the CFMAIL, CFFTP, CFDIRECTORY, CFFILE, etc. instead of the link above.

  • How can I add Headers? Footers? Page orientation? How can I break to the next page?

    <CF_DynamicPDF

    myDoc="C:\websites\ghtmldoc.exe"
    pdfFile="test.pdf"
    options="--header .1/ --footer DIt">

    <!-- MEDIA LANDSCAPE Yes -->
    Page 1: This web site is a great source of information.

    <HR BREAK>

    Page 2: You can now navigate through the web site.

    </cf_DynamicPDF>

    The syntax above will create a PDF with Landscape layout. The header and footer are always broken into three sections, left, center, and right. The header in this document will have .1/ which you can translate using the documentation. "." means leave the left section of the header blank. "1" means add numbers in the center of each page. 1 goes for the first page, 2 for the second, etc. "/" means add the current and total number of pages to the right section of the header. For the footer, "D" means the left section of the footer should include the current data and time. "I" means the center of the footer should include the number of the current page using captial Roman numbering. "t" means the right section of the footer should have the document title.

    The statment "Page 1: This web site is a great source of information." will be printed on the first page of the generated PDF, while the statement "Page 2: You can now navigate through the web site." on the second page of the generated PDF.

Frequently Asked Questions   Go to top   Purchase it

  • What do you mean by one-domain license vs. unlimited-domain licenses?

    One-domain license means that you are purchasing DynamicPDF 1.0 to develop the application on only one ColdFusion Server for one domain. Shared servers do not count.

    In case of a shared server, multiple domains, or multiple ColdFusion Servers, the unlimited-domain license should be purchased instead.

  • How do I obtain support on my purchase?

    With your purchase, you will get FREE support while setting up your application until you have it up and running. You are also welcome to forward to us any questions regarding DynamicPDF 1.0 or to request code optimization suggestions. However, if you do not purchase one of our 3 support options, then your email will take on lower importance than other clients' who have purchased one of those options. We might not get back to you until we resolve all the other issues that other clients, who have purchased support, are inquirying about. So, we suggest you purchase at least the 1-month support and warranty (only $9!).

  • How can you re-distribute HTMLDOC 1.8.23 and it is not even yours?

    HTMLDOC 1.8.23 was developed under GNU GPL license terms. As long as Gilgamesh Solutions, Inc. does not change the code, or sell it, we can re-distribute it as is. If you are interested, you can read further about the GNU GPL license terms by accessing the following URL: http://www.fsf.org/copyleft/gpl-faq.html
Terms of Use  ©2001- 2008 Gilgamesh Solutions, Inc. All rights reserved.