HTML to PDF converter for Java and .NET

HOME   FEATURES   PRODUCTS   DOWNLOADS   BUY NOW!   SUPPORT

PD4ML Integration with Macromedia® ColdFusion® MX

1. Integration of PD4ML with ColdFusion MX 6 Professional or ColdFusion MX 6 Development edition running on JRun 4

Please follow the link to the corresponding section in the Reference manual.

2. Integration of PD4ML with ColdFusion Standard edition

Unfortunately not all runtime modes of ColdFusion allow to use JSP tag libraries. In that case the only way to integrate PD4ML is to use PD4ML Java API.

The following is the integration example .cfm contributed by David REYNAUD:

<html>

<head>

<title>PD4ML under CFMX 6.x Std Edition</title>

</head>

 

<body>

<!---

BEFORE RUNNING :

       Idea 1 :

             put the JAR file : pd4ml_demo.jar

             in the same folder as current CFM page

       Idea 2 :

             maybe you can put the JAR file : pd4ml_demo.jar

             into the ColfdFusion's CustomTags directory

       Idea 3 :

             use the ColdFusion Admin to configure classpath to use the jar

--->

<cfscript>

       // The source file to convert  (http:// or file:)

       inURI="file:n:/web/tests/pd4ml/test.html";

       // The pdf file to generate (full pathname)

       fileOut="n:/web/tests/pd4ml/test.pdf";

      

       unnitsvalue="mm";  // Millimeters

       // A4 'vertical' in mm

       format = createObject("java","java.awt.Dimension").init(210,297);

       topValue = 10;     // mm

       leftValue = 10;    // mm

       rightValue = 10;   // mm

       bottomValue = 10;  // mm

       landscapevalue="yes";

      

       userSpaceWidth=780; // px

       splitValue=0;

       patchValue=1;

 

       authorName="";

 

       // PD4ML Object instantiation

       pd4ml = createObject("java","org.zefer.pd4ml.PD4ML");

      

       // Format, orientation, insets

       if (landscapeValue) format = pd4ml.changePageOrientation(format);

       insets = createObject("java","java.awt.Insets")

.init(topValue,leftValue,bottomValue,rightValue);

       if (unnitsvalue EQ "mm") {

              pd4ml.setPageSizeMM(format);

             pd4ml.setPageInsetsMM(insets);

} else {

             pd4ml.setPageSize(format);

             pd4ml.setPageInsets(insets);

       }

      

       if(authorName NEQ "")

pd4ml.setAuthorName(authorname);

      

       if (userSpaceWidth NEQ "") pd4ml.setHtmlWidth( userSpaceWidth );

       pd4ml.enableImgSplit( splitValue );

       pd4ml.enableRenderingPatch( patchValue );

 

       fos = createObject("java","java.io.FileOutputStream").init(fileOut);

       pd4ml.render(inURI,fos); // Start rendering

 

</cfscript>

<cfoutput>File '#inURI#' converted to '#fileOut#'</cfoutput>

</body>

</html>

DOWNLOAD
fully functional trial
BUY NOW
NEWS

Apr 11, 17
Maintenance PD4ML 3.10.2 (Java) is available for download. See Release Notes

Mar 12, 17
PD4ML Java 3.10.1 is available for download

News archive...
Copyright ©2004-17 zefer|org. All rights reserved. Bookmark and Share