HTML to PDF converter for Java and .NET


PD4ML Dxl2Pdf: command-line DXL-to-PDF converter tool

(optionally converts to RTF, PNG8, PNG24, multipage TIFF)

The tool extends Pd4Cmd command-line tool functionality with DXL-to-PDF converting features derived from PD4ML Lotus Notes Agent.

The tool package, which includes Dxl2Pdf in source and compiled form, XSL stylesheet, PD4ML evaluation library and supplied stuff can be downloaded from here.


Basic command lines

Dxl2Pdf execution requires pd4ml.jar, ss_css2.jar (PD4ML distribution) and xml.jar (from Lotus Notes) are in the classpath. As long as ss_css2.jar is in the list of pd4ml.jar dependencies, it is sufficient to refer pd4ml.jar from the classpath assuming ss_css2.jar is in the same directory.

Evaluation versions of PD4ML include pd4ml_demo.jar instead of pd4ml.jar. If needed please substitute the names correspondingly in the command-line examples below.

A synopsis of Dxl2Pdf parameters (differences from Pd4Cmd are highlighted):

java -Xmx512m [-Djava.awt.headless=true] Dxl2Pdf '<dxl_path>' <htmlWidth> [pageFormatName|WxH] [-xsl <xsl_path>] [-pdfa] [-smarttablesplit] [-permissions <NUMBER>] [-bookmarks <HEADINGS|ANCHORS>] [-orientation <PORTRAIT|LANDSCAPE>] [-insets <T,L,B,R,><mm|pt>] [-bgcolor <#RGB>] [-bgimage '<url>'] [-ttf <ttf_fonts_dir>][-addstyle <CSS code>] [-pdfforms] [-protectpud] [-adjustwidth] [-fitapage] [-nohyperlinks] [-noimagesplit] [-author <author name>] [-title <title override>] [-cookie <name> <value>] [-param <name> <value>] [-header '<header HTML code>'] [-footer '<footer HTML code>'] [-pagerange <page>] [-out <output_file_path>] [-password <password>] [-usetmpfiles] [-dumphtml] [-debug]


HTML-to-PDF conversion with the absolute minimum of parameters

java -Xmx512m -cp pd4ml.jar;xml.jar;. Dxl2Pdf test.dxl 1200

UNIX-derived operating systems:
java -Xmx512m -Djava.awt.headless=true -cp pd4ml.jar:xml.jar:. Dxl2Pdf test.dxl 1200

The command line overrides the default Java memory heap size limit with -Xmx512m. Here it is set to 512Mb.

On UNIX platform -Djava.awt.headless=true allows to run the application on non-graphics-enabled servers or from remote ssh/telnet sessions.

test.dxl 1200 are DXL location and htmlWidth (virtual "browser" frame width) parameters.
Please note: on Win32 the path is enclosed, if needed, to double quotes, on UNIX - to single quotes.

The default PDF document format: A4 / PORTRAIT

In the example 1200px width of rendered document will be mapped to 595pt widths of A4 page format.

As long as an output file path omitted, the output is sent to STDOUT and can be piped to another application.


Command-line parameters, additional to Pd4Cmd parameters

Pd4Cmd parameter Description
-xsl <xsl path> DXL-to-HTML transforming XSL stylesheet to use. Default value is dxl4pd4ml.xsl


-xsl c:/mystyles/improoved.xsl
-usetmpfiles Forces the tool to extract Base64-encoded Notes attachments and to store them as temporal files instead of passing the bulky data to Xalan
-dumphtml Forces to dump interim HTML document to STDOUT. The parameter is ignored if no -out parameter given and STDOUT is used to output resulting PDF.
Additional information
  1. Pd4Cmd documentation
  2. PD4ML for Lotus Notes
  3. PD4ML API reference
  4. Dxl2Pdf download (~5.5 Mb)


Copyright ©2004-21 zefer|org. All rights reserved. Bookmark and Share