VeryPDF HTML Converter Command Line User Manual

Download HTML Converter Command Line: Download

Purchase HTML Converter Command Line: Purchase

VeryPDF HTML Converter is a powerful software product. It can create previews or nice-looking and high-quality thumbnails of web pages in a number of different formats, such as TIF, TIFF, JPG, JPEG, GIF, PNG, BMP, PCX, TGA, JP2 (JPEG2000), PNM, etc., and decrease images and convert thumbnails to JPEG, GIF, PNG, etc. web compatible formats. It also allows you to convert web pages to PDF, PS (postscript), WMF, EMF vector formats and to convert various types of images from watched folders into PDF files as a Windows NT service process, or batch convert if you deal with large amount of files.

 

The VeryPDF HTML Converter renders web pages quickly and accurately, not depending on any print drivers. It can be setup on web-servers, used from service, launched within other programs from the command line. In our products, there are two kinds of VeryPDF HTML Converter product, one is a graphical user interface (GUI) application and the other is a command-line application. It’s up to users to select which kind to use. Most of users are probably accustomed to editing images one at a time with a GUI with such programs as gimp or Photoshop. However, a GUI is not always convenient. Suppose you want to process an image dynamically from a web script or you want to apply the same operations to many images or repeat a specific operation at different times to the same or different image. In these cases, the command-line image processing utility is appropriate.

 

In this user manual, we mainly introduce how to use the command-line application.

Contents

1. Overview of the command-line application

1.1 Supported image types

1.2 List of supported conversions

1.3 System requirements

1.4 Features

1.5 Installation

2. Command-line usage

   2.1 Getting started

   2.2 How to convert

2.2.1 How to convert webpage or HTML file to PDF, PS file

2.2.2 How to convert webpage or HTML file to EMF, JPG, GIF file

2.2.3 How to convert webpage or HTML file to TXT file

2.2.4 How to convert EMF to PDF, TIF, JPG

2.2.5 How to convert TXT to PDF file

2.2.6 How to convert PDF to PS file

2.2.7 How to convert WMF to PDF file

2.2.8 How to convert RTF to PDF file

2.2.9 How to set output file’s rotate angle

2.2.10 How to set web browser’s width and height for HTML

2.2.11 How to set HTML link’s level

2.2.12 How to disable hyperlinks to the converted file

2.2.13 How to enable ActiveX, Java and Scripts

2.2.14 How to enable Unicode

2.2.15 How to enable RclBounds

2.2.16 How to set page height and width

2.2.17 How to set margin

2.2.18 How to set timeout and time delay for conversion

2.2.19 How to view after conversion

   2.3 How to save

   2.3.1 How to split a file

   2.3.2 How to merge files

2.3.3 How to insert a file

2.3.4 How to create a PDF/A compliance PDF file

2.3.5 How to create a PDF/X compliance PDF file

   2.4 How to add document properties

   2.5 How to set security

2.5.1 How to set password

2.5.2 How to encrypt

2.5.3 How to post user name and password to a URL

   2.6 How to create bookmark

   2.7 How to add watermark

2.7.1 Watermark content

2.7.2 Set the type of watermark

2.7.3 Set the font of watermark

2.7.4 Set the angle of watermark

2.7.5 Add a rectangle to output watermark

2.7.6 Set text align

2.7.7 Color of watermark

2.7.8 Offset of watermark

   2.8 Copyright and version information

   2.9 Register

   2.10 Help

1. Overview of the command-line application

This part lists all of the functions of command-line application users may be interested in.

1.1 Supported image types

The command-line product supports the following image types:

 

TIFF (Tagged Image File Format)

JPEG (Joint Photographic Expert Group)

PNG (Portable Network Graphics)

GIF (Graphics Interchange Format)

BMP (Window Bitmap)

JPEG2000

PBM (Portable Bitmap Format)

EMF (Windows Enhanced Metafile)

WMF (Windows Metafile)
PCX (PC Paintbrush File format)

TGA (Truevision Targa)

1.2 List of supported conversions

          HTML to PDF, PS (Postscript), TXT, TIF, TIFF, JPG, JPEG, GIF, PNG, BMP, EMF, WMF, PCX, TGA, JP2, PNM

          EMF to PDF, PS (Postscript), TIF, TIFF, JPG, JPEG, GIF, PNG, BMP, WMF, EMF, PCX, TGA, JP2, PNM

          WMF to PDF, PS (Postscript), TIF, TIFF, JPG, JPEG, GIF, PNG, BMP, WMF, EMF, PCX, TGA, JP2, PNM

          RTF to PDF, PS (Postscript), TIF, TIFF, JPG, JPEG, GIF, PNG, BMP, WMF, EMF, PCX, TGA, JP2, PNM

1.3 System Requirements

Windows Platform, Internet Explorer 5 above, Internet connection.

1.4 Features

        Adobe Acrobat and Reader NOT required!

        NOT depending on any Printer Driver products.

        Entire website to PDF and PS conversion

          Creates a multi-page PDF or PS file for all pages of a website automatically.

          Converts HTML and Web pages to text files.

          Sets Timeout and Time Delay for conversion.

          Enable/Disable unicode, java, ActiveX, Scripts, EMF's rclBound within HTML Conversion.

          Customizes paper size for HTML to PDF conversion.

          Supports asp, cgi, css, Java Applets, flash, cookie, etc. elements within HTML conversion.

          Sets to automatically open PDF file after creation.

          Sets the document’s title, subject, author and keywords.

          PDF documents created fully text searchable in Adobe Reader.

          Adjusts web browser window's width and height to fit the HTML contents.

          Auto adjusts PDF or content width if necessary.

          Preserves hyperlinks within HTML to PDF conversion.

          Rewrites links in local HTML files if necessary.

          Supports page breaks.

          Sets page orientation (Portrait or Landscape) for HTML Conversion.

          Supports frames within Web pages or HTML files.

          Smart pagination of produced PDF files.

          Supports 0, 90, 180, and 270 rotations for PDF, PS files.

        Supports batch conversion

          Several document files merged to a single PDF file, or each document file converted into a PDF file.

          Sorts on file name.

          Converts a batch of HTML documents located in a Folder using a file filter (such as *.html).

          Use command line versions in batch and unattended operations.

        Support single file process, single directory process, multi-level directory process and many other process way.

        Output file protection

          Create "owner password" and "user password".

          Password with 40 or 128 bit encryption.

        Supports wildcard character, for example: *.html, a*.htm, *.emf, *.wmf etc.

        Document to image conversion

          Supports color depth and resolution settings.

          Supports 0, 90, 180, and 270 rotations.

        Merges documents

          Multiple PDF files into a PDF file.

          Merges files listed in a TXT file, a file which contains file names to be merged, one file name per line.

        Called from other applications or program languages

          By Web-based applications to converts HTML, RTF, WMF, EMF files to PDF, PS (Postscript), TXT, TIF, TIFF, JPG, JPEG, GIF, PNG, BMP, WMF, EMF, PCX, TGA, JP2, PNM dynamically at run time.

          Integrate high-volume batch conversion into the server-based application or workflow.

          Called from within ASP, VB, VC, Delphi, BCB, Java, .NET and COM+ etc. program languages.

          Allows efficient asynchronous multithreaded operations.

        Support PDF/X, PDF/A compliance PDF convertion

 

1.5 Installation

          Download the zip file

The command line product can be download htmltools.zip file from /htmltools/index.html#dl

          Unzip/extract the file using a tool like WinZip available from WinZip Computing, Inc. at http://www.winzip.com to a directory on your hard disk where your program files reside. Check the appropriate option to preserve file paths (Use folder names). The unzip process now creates the following subdirectories

• Bin: Contains the runtime executable binary code

• Doc: Contains documentation files

 

Back to top

2. Command Line Usage

In this part, we give a brief introduction to the command-line in sub-part 2.1 and a detail introduction in sub-part 2.2. The sub-part 2.1 will briefly introduce all of the commands in VeryPDF HTML Converter Command line application. Users who are familiar with command-line utilities can read this part and quickly get to know all of the usage.  Those who are not familiar with can go directly to sub-part 2.2 to get the detail usage.

2.1 Getting started

You can follow the steps to quickly begin to use command-line application:

         Click Start menu

 

         Clicking the entry "Run" opens the box shown below, where commands may be typed and entered.

         Input "cmd" to open a command prompt window.

 

Note:

For Windows VistaTM operation system, you should use "Run As administrator" to run cmd.exe.

         Then input the command line as following form:

htmltools.exe [options] "input-file" "output-file"<EMF-WMF-HTML-URL-RTF-file> [<PDF-PS-Image-file>]

where [options] can be any of the following commands:

-activex 

 

Enable ActiveX for HTML conversion

-append <int>

 

insert a file

 

-append 0

Overwrite if PDF file exists

 

-append 1

Insert before first page if PDF file exists

 

-append 2

Append to last page if PDF file exists

 

-append 3

Rename filename if PDF file exists

-author <string>

 

Set 'author' to PDF file

-bheight <int>

 

Set web browser's height for HTML conversion

-bitcount <int>

 

Set color depth for image conversion

-bookmark <int>

 

Create bookmark to PDF file

 

-bookmark 1

Use short filename as bookmarks

 

-bookmark 2

Use full filename as bookmarks

 

-bookmark 3 

Use short filename without suffix as bookmarks

-burstpdf <string>

 

Burst a PDF file into several single page PDF files

-bwidth <int>

 

Set web browser's width for HTML conversion

-creator <string>

 

Set 'creator' to PDF file

-delaytime <int>

 

Set delay time in milliseconds for HTML conversion

-disablelinks

 

Disable hyperlinks within HTML to PDF conversion

-emfheight <int>

 

Split a long EMF file by this height

-encryption <int>

 

Restrictions

 

-encryption 0

Encrypt the file only

 

-encryption 3900

Deny anything

 

-encryption 4

Deny printing

 

-encryption 8

Deny modification of contents

 

-encryption 16

Deny copying of contents

 

-encryption 32

No commenting

 

-encryption 256

Deny FillInFormFields

 

-encryption 512

Deny ExtractObj

 

-encryption 1024

Deny Assemble

 

-encryption 2048

Disable high resolution Printing

 

-encryption 4096

Do not encrypt metadata

-forcesplitemf

 

Force split EMF file by emfheight

-h

 

Show help information

-height <int>

 

Set page height to PDF file

-help

 

Show help information

--help

 

Show help information

-htmllevel <int>

 

Set link's level for HTML conversion

-java

 

Enable Java for HTML conversion

-keylen <int>

 

Key length (40 or 128 bit)

 

-keylen 0

40 bit RC4 encryption (Acrobat 3 or higher)

 

-keylen 1

128 bit RC4 encryption (Acrobat 5 or higher)

 

-keylen 2

128 bit RC4 encryption (Acrobat 6 or higher)

-keywords <string>

 

Set 'keywords' to PDF file

-margin <string>

 

Set page margin to PDF file

 

-margin 10 

Set margin to 10pt to left

 

-margin 10x10

Set margin to 10pt to left, top

 

-margin 10x10x10

Set margin to 10pt to left, top, right

 

-margin 10x10x10x10

Set margin to 10pt to left, top, right, bottom

-mergepdf <string>

 

Merge several PDF files into one

 

-mergepdf "<file1|file2|file3|...>"

Merge PDF files into one PDF file

 

-mergepdf "C:\filelist.txt"

Merge PDF files from a .txt file

 

mergepdf "C:\*.pdf"

Merge multiple PDF files into one PDF file

-nocenter

 

Don't center the contents in the PDF file

-noempty

 

Delete empty pages from PDF file

-nosplitimg

 

Don't break images in HTML file

-openpwd <string>

 

Set 'open password' to PDF file

-ownerpwd <string>

 

Set 'owner password' to PDF file

-pdf2ps <string>

 

Convert PDF to PS

-pdfa

 

Create PDF/A compliance PDF file

-pdfx

 

Create PDF/X compliance PDF file

-postdata <string>

 

Set the data to be posted to the URL. Use this function for some urls protected by forms

-producer <string> 

 

Set 'producer' to PDF file

-rclbounds

 

Use rclBounds instead of rclFrame

-rotate <int>

 

Rotate pages, 90, 180, 270

-script

 

Enable script for HTML conversion

-subject <string>

 

Set 'subject' to PDF file

-timeout <int>

 

Set timeout in milliseconds for HTML conversion

-title <string>

 

Set 'title' to PDF file

-unicode

 

Enable Unicode conversion

-v

 

Show copyright and version information

-view

 

View PDF file after creation

-wa <int>

 

angle of watermark

-walign <int>

 

set text align对齐

 

-walign 1

left

 

-walign 2

center

 

-walign 3

right

-wb

 

specify bold font

-wbox <string>

 

a rectangle to output formatted text, only useful for "-walign" option

-wc <string>

 

color of watermark

 

-wc FF0000

Red color

 

-wc 00FF00

Green color

 

-wc 0000FF

Blue color

 

-wc HexNum

Other colors

-wf <string>

 

font name of watermark

-wh <int>

 

font size of watermark

-wi 

 

specify an italic font

-width <int>

 

Set page width to PDF file

-ws

 

specify a strikeout font

-wtext <string>

 

watermark content on converted document

-wtype <int>

 

type of watermark

 

-wtype 0

normal watermark

 

-wtype 1

watermark on header

 

-wtype 2

watermark on footer

-wu 

 

specify an underlined font

-wx <int>

 

X offset of watermark

-wy <int>

 

Y offset of watermark

-xres <int>

 

Set X resolution to image file

-yres <int>

 

Set Y resolution to image file

-?

 

Show help information

-$ <string>

 

Input registration key

            

The command line syntax is UNIX like. Command line arguments in brackets ([ ...]) are optional.

 

Back to top

2.2 How to convert

The conversion includes from HTML files to specified output files, documents to image files and other files to PDF/PS files, with the set of page sizes, file formats, file’s width or height, image’s color and resolution, page orientation, and so on. Set the format of output files, rotate angle, browser’s width and height, timeout and delay time, html link level, and so on.

 

2.2.1 How to convert webpage or HTML file to PDF, PS file

You can use the following command to convert a webpage to PDF or PS file:

htmltools.exe "URL" "output_file"

 

For example, you can input

htmltools.exe "http://www.verypdf.com" C:\out.pdf

to convert a webpage to PDF file, or

htmltools.exe "http://www.verypdf.com" C:\out.ps

to convert a webpage to PS file.

 

To convert multiple HTML files to multiple PDF files

htmltools.exe C:\*.htm C:\*.pdf

 

If you don't want to center the content in height of PDF file, you can use the command:

-nocenter

 

To delete empty pages to the converted file, you can use the command:

-noempty

 

Back to top

2.2.2 How to convert webpage or HTML file to EMF, JPG, GIF file

htmltools.exe "http://www.verypdf.com" C:\out.emf

to convert a webpage to EMF file, or

htmltools.exe "http://www.verypdf.com" C:\out.jpg

to convert a webpage to JPG file, or

htmltools.exe "http://www.verypdf.com" C:\out.gif

to convert a webpage to GIF file,

You can also convert an html file to another format file, e.g.

htmltools.exe "C:\in.html" C:\out.gif

Sets color depth and resolution settings within document to image conversion.

 

Back to top

2.2.2.1 How to convert and set color depth

Set the color depth for the image formats (TIFF, JPEG, PCX, BMP, etc.) within conversion.

-bitcount

htmltools.exe -bitcount value C:\input_file C:\output_file

where the value can be an integer representing the color depth.

 

For example,

htmltools.exe -bitcount 1 "http://www.verypdf.com" C:\out.tif

 

Back to top

2.2.2.2 How to  convert and set resolution

Set the DPI resolution for the image formats (TIFF, JPEG, PCX, BMP, etc.) within conversion.

-xres, -yres

htmltools.exe -xres value1 -yres value2 C:\input_file C:\output_file

where value1 and value2 are X resolution and Y resolution to the image file, respectively.

 

For example,

htmltools.exe -xres 600 -yres 600 C:\out.emf C:\out.tif

 

Back to top

2.2.3 How to convert webpage or HTML file to TXT file

htmltools.exe "http://www.verypdf.com" C:\out.txt

to convert to TXT file.

 

Back to top

2.2.4 How to convert EMF to PDF, TIF, JPG

htmltools.exe C:\in.emf C:\out.pdf

to convert EMF file to PDF file, and

htmltools.exe C:\*.emf C:\*.pdf

to convert all of EMF files to the same name of PDF files.

 

And, you can use the following command

htmltools.exe C:\input.emf C:\out.tif

to  convert  EMF to TIF file, and

htmltools.exe C:\input.emf C:\out.jpg

to convert EMF to JPG file, and

htmltools.exe -xres 600 -yres 600 C:\input.emf C:\out.tif

to convert EMF to TIF file in 600DPI.

 

Back to top

2.2.5 How to convert TXT to PDF file

htmltools.exe C:\input.txt C:\out.pdf

 

For example, you can input

htmltools.exe C:\filelist.txt C:\out.pdf

to convert all of the flie listed in "filelist.txt" to a PDF file.

 

Back to top

2.2.6 How to convert PDF to PS file

-pdf2ps <string>

htmltools.exe -pdf2ps C:\test.pdf C:\out.ps

2.2.7 How to convert WMF to PDF file

htmltools.exe C:\input.wmf C:\out.pdf

 

2.2.8 How to convert  RTF to PDF file

htmltools.exe C:\input.rtf C:\out.pdf

 

2.2.9 How to set output file’s rotate angle

We can this command to set 90, 180, 270 angle rotation when converting an html file to PDF, PS and image formats.

-rotate <int>

htmltools.exe -rotate angle htmlfile C:\outfile

where the angle can be 90, 180 or 270

For example, you can use the command

htmltools.exe -rotate 90 "http://www.google.com" C:\out.pdf

to convert a webpage (http://www.google.com) to a PDF file (C:\out.pdf) and rotate the file 90º.

 

Back to top

2.2.10 How to set web browser’s width and height for HTML

Adjust width and height of the window of a web browser to adapt to the HTML contents automatically.

-bwidth <int>

-bheight <int

htmltools.exe -bwidth value1 -bheight value2 URL C:\output_file

where value1 and value2 are the width and height of the web browser respectively.

 

Note:

value1 and value2 should no greater than the resolution of your computer. If Width is 0, then use the full width of the html page and if the html page width is larger than Width, it is cropped to get the specified results. This applies to Height similarly.This command can generate an image file to the same size of the values. The width and height are the same as that of HTML page in default.

 

For example, we can input the command

htmltools.exe -bwidth 100 -bheight 100 "http://www.verypdf.com" C:\out.pdf

 

Back to top

2.2.11 How to set HTML link’s level

Convert HTML and its sub-pages to other formats.

-htmllevel <int>

htmltools.exe -htmllevel value C:\input_file C:\output_file

where the value is the level number, such as 0, 1, 2, and so on...

 

Note:

Link level is the hierarchy of web pages, the parent page is in the high level and its child page is in the low level, such as level 0 page is the parent of level 1. Usually, one parent page may have several child pages. Once we specify a level, the command can convert all of the pages linked in this level one by one into a PDF, PS or other image format file.

If you use level 0, this command will convert the current web page into another specified format file, which is also a default number, and 1 means to convert the page of level 0 and secondly all of the pages of level 1, and 2 means to convert the current page and all of its child and child's child page, and so on...

 

For example, you can input

htmltools.exe -htmllevel 1 "/htmltools/html-tools.html" "C:\verypdf_site1.pdf"

or

htmltools.exe -htmllevel 2 "/htmltools/html-tools.html" "%CD%_site1.pdf"

 

Back to top

2.2.12 How to disable hyperlinks to the converted file

To cancel all of hyperlinks of a PDF file when it is conveted from an HTML file.

-disablelinks

For example,

htmltools.exe -disablelinks "C:\in.html" C:\out.pdf

2.2.13 How to enable ActiveX, Java and Scripts

Determine if ActiveX is enabled on the html page.

-activex

Determine if Java is enabled on the html page.

-java

Determine if Script is enabled on the html page.

-script

htmltools.exe -activex -java -script C:\input.html C:\output_file

You can use these commands to enable activex, java or script on the html page.

 

Back to top

2.2.14 How to enable Unicode

Enable Unicode for HTML to EMF and EMF to PDF/PS Conversion.

 

-unicode

htmltools.exe -unicode C:\input.emf C:\output_file

or

htmltools.exe -unicode URL C:\output_file

 

Note:

You can use this command to ignore the character set within CreateFont() records and print all strings in Unicode mode (EMF files contain Unicode strings only). This command can be used to avoid the conversion of strings to the ANSI character set if ANSI_CHARSET was used in the CreateFont() record. The character set is often wrongly defined in EMF files so that characters outside of the ANSI_CHARSET are replaced by question marks due to the default conversion to ANSI if the character set ANSI_CHARSET is used.

 

Back to top

2.2.15 How to enable RclBounds

Use rclBounds to instead of rclFrame within HTML to EMF and EMF to PDF/PS Conversion.

-rclbounds

htmltools.exe -rclbounds C:\input_file C:\output_file

where the input_file can be HTML, EMF and WMF format files, and output_file can be PDF, PS and image files.

Note:

There are two members in the structure of metafile data: rclBounds and rclFrame.

rclBounds specifies the dimensions, in device units, of the smallest rectangle that can be drawn around the picture stored in the metafile. This rectangle is supplied by graphics device interface (GDI). Its dimensions include the right and bottom edges.

rclFrame specifies the dimensions, in .01 millimeter units, of a rectangle that surrounds the picture stored in the metafile. This rectangle must be supplied by the application that creates the metafile. Its dimensions include the right and bottom edges.

In htmltools command line program, the default value used is rclFrame. The rectangle that rclFrame specified is changed if the metafile will be rendered onto a monitor DC or printer DC. To get consistent output results, the output frame can be ingnored. The graphic must be placed manually onto the output page. You can use the command -rclbounds to represent the visible extent of the picture.

Back to top

2.2.16 How to set page height and width

Set the paper size for PDF output.

-height <int>

-width <int>

htmltools.exe -height value1 -width value2 C:\input_file C:\output_file

where the value1 and value2 are the height and width of the page of PDF files

For example, you can input

htmltools.exe -width 612 -height 792 C:\in.emf C:\out.pdf

 

Note:

Usually, in case of width is shorter than height, we call the page is a portrait orientation, or else we call a landscape orientation. The following figure shows their difference.

For example, for the command

htmltools.exe -nocenter -width 612 -height 792 -emfheight 792 -nosplitimg "/" "C:\multipage.pdf"

we can exchange the value of width with that of height as

htmltools.exe -nocenter -width 792 -height 612 -emfheight 792 -nosplitimg "/" "C:\multipage.pdf"

to change the portrait orientation to landscape orientation.

 

Back to top

2.2.17 How to set margin

Set paper margins to the left, top, right and bottom sides.

-margin

htmltools.exe -margin value C:\input_file  C:\output_file

where the value can be:

 10 : Set margin to 10pt to left

 10x10 : Set margin to 10pt to left,top

 10x10x10 : Set margin to 10pt to left,top,right

 10x10x10x10 : Set margin to 10pt to left,top,right,bottom

 

For example, you can input the command

htmltools.exe -margin 100x100x100x100 C:\in.rtf C:\out.pdf

 

Back to top

2.2.18 How to Set timeout and time delay for conversion

-timeout

htmltools.exe -timeout value URL C:\out.pdf

where the value in milliseconds is the waiting time when downloading a web page. We can use this command to avoid hang. The default value is 30000.

-delaytime

htmltools.exe -delaytime value URL C:\out.pdf

where the value in milliseconds is the waiting time after a html document is downloaded. Sometimes, a page contains an ActiveX like a flash, which takes some time to initialize. This method can be used to control the timing to capture the content of the dynamic embeded objects. The default value is 1000.

Back to top

2.2.19 How to view after conversion

Automatically open PDF file after creation.

-view

htmltools.exe -view C:\input_file C:\output_file

 

Back to top

2.3 How to save

After files are converted to another format, you may want to save the outputs. If one of the files is too long, you can split it first, or if you want all the outputs saved in one file, you can merge them or insert the output to other files. VeryPDF HTML Converter command line provides the following commands to meet your needs.

2.3.1 How to split a file

2.3.1.1 How to burst a PDF file into single page PDF files

-burstpdf <string>

htmltools.exe -burstpdf "C:\in.pdf" "C:\out.pdf"

to divide a multiple-page file into several small files, one file one page.

2.3.1.2 How to split a long HTML file to multiple PDF files

-emfheight <int>

htmltools.exe -emfheight value URL C:\output.pdf

where the value is the height of the split file.

 

Note:

(1) You can use "-width" and "-height" parameters to set the paper size for the conversion of HTML to PDF (see 2.2.16), and you can also use "-emfheight" parameter to break a long html page into a multi-page PDF file. For example, if you want to create a A4 size PDF file, you can input the command as follows

htmltools.exe -nocenter -width 612 -height 792 -emfheight 792   "/pdfcamp/convert-html-to-pdf.html" "C:\out.pdf"

 

The unit is point for "-width", "-height", "-emfheight" parameters, you can convert from inch to point easily, for example,

8.5inch = 8.5x72 = 612pt

11inch = 11x72 = 792pt

 

(2) height and width are the size of PDF page, and emfheight is the height of content after splitting in one PDF page. If the emfheight is greater than height, the content size of one page can be scaled to the height of the PDF page.

 

If an image is a bit longer to be divided to two pages, you can use the command

-nosplitting

to prevent emfheight from breaking it. For example,

htmltools.exe -nocenter -width 612 -height 792 -emfheight 792 -nosplitimg "/" "C:\multipage.pdf"

 

If you want to split a long html file in a specified height, you can use the command

-forcesplitemf

together with emfheight. For example,

htmltools.exe -nocenter -width 612 -height 792 -emfheight 792 -forcesplitemf -nosplitimg "/" "C:\multipage.pdf"

Without forcesplitemf, the command line application can adjust automatically the splitting point to not divide any word into two parts.

 

Back to top

2.3.2 How to merge files

-mergepdf <string>

You can use this command to merge multiple files to one file.

For example, to list all of the files to merge, you can use the form:

-mergepdf "file1|file2|file3|..."

htmltools.exe -mergepdf "C:\001.pdf|C:\002.pdf|C:\003.pdf" "C:\out.pdf"

or

htmltools.exe -mergepdf "C:\1.pdf|C:\2.pdf|C:\3.pdf" C:\out.pdf

 

To merge all of the PDF file into one PDF file, you can use the following form:

-mergepdf "C:\*.pdf"

htmltools.exe -mergepdf "C:\*.pdf" C:\out.pdf

 

If there are a large amount of files to merge, you can first create a TXT file to record all of the files’ path, e.g. filelist.txt (use the command "dir C:\test\*.pdf /s/b > C:\filelist.txt", for example), and then use the following command:

-mergepdf "C:\filelist.txt"

htmltools.exe -mergepdf "C:\filelist.txt" C:\out.pdf

 

Back to top

2.3.3 How to insert a file

If files exist, we can use the command to rename the new file, insert before the first page or append to the last page.

 

-append <int

htmltools.exe –append value C:\in_file C:\out_file

where the value can be:

0  : Overwrite if File exists

1  : Insert before the first page if file exists

2  : Append to the last page if file exists

3  : Rename if file exists

 

-append 0

htmltools.exe -append 0 "http://www.verypdf.com" C:\out.pdf

If C:\out.pdf is already exists, this command will first delete it and recreate a new file out.pdf.

 

-append 1

htmltools.exe -append 1 C:\in.emf C:\out.pdf

 

-append 2

htmltools.exe -append 2 C:\in.emf C:\out.pdf

htmltools.exe -append 2 -width 612 -height 792 C:\*.emf C:\out.pdf

htmltools.exe -append 2 C:\*.emf C:\out.pdf

 

-append 3

for example,

htmltools.exe -append 3 "http://www.verypdf.com" C:\out.pdf

If out.pdf is already exists, this command can rename the converted result to out000.pdf, etc.

 

Back to top

2.3.4 How to create a PDF/A compliance PDF file

If you want to preserve your documents for a long time, you can use this command at the time you convert a file.

-pdfa

htmltools.exe -pdfa http://www.verypdf.com C:\out.pdf

 

Note:

PDF/A is a file format for the long-term archiving of electronic documents. It is based on the PDF Reference Version 1.4 from Adobe Systems Inc. (implemented in Adobe Acrobat 5) and is defined by ISO 19005-1:2005, an ISO Standard that was published on October 1, 2005:

  • Document Management - Electronic document file format for long term preservation - Part 1: Use of PDF 1.4 (PDF/A-1)

PDF/A is in fact a subset of PDF, obtained by leaving out PDF features not suited to long-term archiving. This is similar to the definition of the PDF/X subset for the printing and graphic arts.

The Standard does not define an archiving strategy or the goals of an archiving system. It identifies a "profile" for electronic documents that ensures the documents can be reproduced the exact same way in years to come. A key element to this reproducibility is the requirement for PDF/A documents to be 100 % self-contained. All of the information necessary for displaying the document in the same manner every time is embedded in the file. This includes, but is not limited to, all content (text, raster images and vector graphics), fonts, and color information. A PDF/A document is not permitted to be reliant on information from external sources (e.g. font programs and hyperlinks).

Other key elements to PDF/A compatibility include:

  • Audio and video content are forbidden.
  • JavaScript and executable file launches are prohibited.
  • All fonts must be embedded and also must be legally embeddable for unlimited, universal rendering. This also applies to the so-called PostScript standard fonts such as Times or Helvetica.
  • Colorspaces specified in a device-independent manner.
  • Encryption is disallowed.
  • Use of standards-based metadata is mandated.

PDF/A was originally a new joint activity between NPES - The Association for Suppliers of Printing, Publishing and Converting Technologies, and the Association for Information and Image Management, International (AIIM International) to develop an International standard that defines the use of the Portable Document Format (PDF) for archiving and preserving documents. The goal was to address the growing need to electronically archive documents in a way that will ensure preservation of their contents over an extended period of time, and will further ensure that those documents will be able to be retrieved and rendered with a consistent and predictable result in the future. This need exists in a growing number of international government and industry segments, including legal systems, libraries, newspapers, regulated industries, and others.

 

Back to top

2.3.5 How to create a PDF/X compliance PDF file

-pdfx

htmltools.exe -pdfx http://www.verypdf.com C:\out.pdf

 

PDF/X is an umbrella term for several ISO standards that define a subset of the PDF standard. The purpose of PDF/X is to facilitate graphics exchange, and it therefore has a series of printing related requirements, which do not apply to standard PDF files. For example, in PDF/X-1a all fonts need to be embedded and all images need to be CMYK or spot colors. PDF/X-2 and PDF/X-3 accept calibrated RGB and CIELAB colors, while retaining most of the other restrictions of PDF/X-1a.

The printing conditions or output intent need to be specified in the file. This can be specified in the form of standard profiles using codes, like "CGATS TR 001 SWOP".

In a PDF/X file that has color managed data each color managed graphic gets its own color profile, so even though the file as a whole is CMYK, individual graphics may be RGB (with calibration information).

Various boxes must be defined. The MediaBox which defines the size of the entire document, either the ArtBox or the TrimBox, which define the extent of the printable area. If the file is to be printed with bleed, a BleedBox, which must be larger than the TrimBox/ArtBox, but smaller than the MediaBox, must be defined.

Active content is not allowed in a PDF/X file. This means that standard PDF features like forms, signatures, comments and embedded sounds and movies are not allowed in PDF/X. Features that are forbidden in the PDF/X standard can sometimes be used, if they do not affect the rendering of the file. This allows for things like annotations outside of the BleedBox.

Back to top

2.4 How to add document properties

The document properties include titles, subjects, authors, keywords, and so on.

-title <string>

-subject <string>

-author <string> 

-keywords <string>

-producer <string>

-creator <string> 

For example,

htmltools.exe -subject "subject" C:\in.emf C:\out.pdf

 

Back to top

2.5 How to set security

2.5.1 How to set password

Create owner password and user password to the protected PDF file.

To set user password, you can use

-openpwd <string>

This is the password required to open document.

 

To set owner password, you can use

-ownerpwd <string>

This is the password required to change permission and password.

 

For example,

htmltools.exe -ownerpwd 123 -keylen 2 -encryption 3900 C:\in.emf C:\out.pdf

 

Back to top

2.5.2 How to encrypt

2.5.2.1 Set the key length

Set 40 or 128 bit Key length.

-keylen <int>

htmltools.exe –keylen value C:\in.pdf C:\out.pdf  

where the value can be:

0  :  40 bit RC4 encryption (Acrobat 3 or higher)

1  :  128 bit RC4 encryption (Acrobat 5 or higher)

2  :  128 bit RC4 encryption (Acrobat 6 or higher)

2.5.2.2 How to set encrypt  restriction

-encryption <int>

htmltools.exe -encryption value C:\in.pdf C:\out.pdf

where the value can be:

0   : Encrypt the file only

4   : Deny printing

8   : Deny modification of contents

16   : Deny copying of contents

32   : No commenting

256 : Deny adding, modifying text annotations and filling in interactive form fileds

512 : Deny extracting of contents

1024: Deny assemble

2048: Disable high resolution Printing

3900: Deny anything, i.e. no adding or changing form fields

4096: Do not encrypt metadata

 

For example,

-encryption 32

htmltools.exe -ownerpwd 123 -keylen 2 -encryption 32 http://www.google.com C:\out.pdf

can be showed in the following figure:

html to pdf converter, security settings

Note:

(1) Command -encryption must be used together with keylen, for each value corresponds to a key length 40 or 128, which should be specified in keylen. For example,

htmltools.exe -ownerpwd 123 -keylen 2 -encryption 3900 C:\in.emf C:\out.pdf

(2) To the command keylen 0, the following commands

-encryption 256, -encryption  512, -encryption 1024, -encryption 2048, -encryption 4096

are invalid. They are valid only to the command keylen 1 or keylen 2.

 

Back to top

2.5.3 How to post user name and password to a URL

Set the data to be posted to the URL. Use this function for some urls protected by forms.

-postdata <string>

htmltools.exe -postdata "UserName=xxxxxx&Password=xxxxxx" http://www.totalshareware.com/ASP/login.asp C:\output.pdf

 

This function is used to encrypt an HTML page, and the arguments following "-postdata" is the content automatically added to the form. Usually, PostData has two parts: header and content. The header is the form "Content-Type: application/x-www-form-urlencoded", and the content can be the form of "user=xxx;password=xxx". htmltool.exe can build a header automatically, so users need to input only the content.

 

Additional information:

In HTML, one can specify two different submission methods for a form. The method is specified inside a FORM element, using the method attribute. The method attribute of the FORM element specifies the HTTP method used to send the form to the processing agent. This attribute may take two values:

method = get | post

where, with the HTTP "get" method, the form data set is appended to the URI specified by the action attribute (with a question-mark ("?") as separator) and this new URI is sent to the processing agent; with the HTTP "post" method, the form data set is included in the body of the form and sent to the processing agent.

 

The "get" method should be used when the form is idempotent (i.e., causes no side-effects). Many database searches have no visible side-effects and make ideal applications for the "get" method. If the service associated with the processing of a form causes side effects (for example, if the form modifies a database or subscription to a service), the "post" method should be used.

 

Back to top

2.6 How to create bookmark

-bookmark <int>

htmltools.exe –bookmark value C:\in_file C:\out_file     

where the value can be:

1   : Use short filename as bookmarks

2   : Use full filename as bookmarks

3   : Use short filename without suffix as bookmarks

For example,

htmltools.exe -bookmark 3 C:\in.emf C:\out.pdf

 

Back to top

2.7 How to add watermark

Sometimes you may want to add watermarks to your converted document, you can use watermark command to add watermarks and set their fonts, colors, sizes and so on.

2.7.1 Watermark content

-wtext <string>

htmltools.exe -wtext "VeryPDF" "C:\in.html" C:\out.pdf

2.7.2 Set the type of watermark

-wtype <int>

htmltools.exe -wtext "VeryPDF" -wtype value "C:\in.html" C:\out.pdf

where the value can be:

0 : normal watermark

1 : watermark on header

2 : watermark on footer

2.7.3 Set the font of watermark

Font name

-wf <string>

htmltools.exe -wtext "VeryPDF" -wf "Arial" "C:\in.html" C:\out.pdf

 

Font size

-wh <int>

htmltools.exe -wtext "VeryPDF" -wf "Arial" -wh 20 "C:\in.html" C:\out.pdf

 

Bold font

-wb

 

Italic font

-wi

 

Underlined font

-wu

 

Strikeout font

-ws

 

For example,

htmltools.exe -wtext "VeryPDF" -wf "Arial" -wh 20 -wb -wi -wu -ws "C:\in.html" C:\out.pdf

 

Back to top

2.7.4 Set the angle of watermark

-wa <int>

htmltools.exe -wtext "VeryPDF" -wtype 0 -wa 45 "C:\in.html" C:\out.pdf

2.7.5 Add a rectangle to output watermark

A rectangle to output formatted text, it is only useful for "-walign" option(see 2.7.6).

-wbox <string>

 

For example,

-wbox "0,0,595,842"

-wbox "0,0,612,792"

 

Back to top

2.7.6 Set text align

-walign <int>

htmltools.exe -wtext "VeryPDF" -wf "Arial" -walign value "C:\in.html" C:\out.pdf

where the value can be:

1 : left

2 : center

3 : right

 

For example,

htmltools.exe -wtext "VeryPDF" -wf "Arial" -walign 3 -wh 20 -wbox "0,770,612,792" "C:\in.html" C:\out.pdf

 

Back to top

2.7.7 Color of watermark

-wc <string>

htmltools.exe -wtext "VeryPDF" -wc value "C:\in.html" C:\out.pdf

where the value can be:

"FF0000" : Red color

"00FF00" : Green color

"0000FF" : Blue color

"HexNum" : Other colors

2.7.8 Offset of watermark

Set X offset of the watermark.

-wx <int>

Set Y offset of the watermark.

-wy <int>

htmltools.exe -wtext "VeryPDF" -wx 100 -wy 100 "C:\in.html" C:\out.pdf

 

Back to top

2.8 Copyright and version information

-v

htmltools.exe –v

 

Back to top

2.9 Register

Input your registration key into HTML Converter, then you can use it without any limitation.

-$ <string>

htmltools.exe "-$" "XXXXXXXXXXXXXXXX"

 

This command can be used with other commands at the same time. For example, you can input the command line as follows,

htmltools.exe "-$" "XXXXXXXXXXXXXXXX" "www.google.com" "C:\out.pdf"

to register and convert your HTML file to PDF file.

 

Back to top

2.10 Help

To show help information, we can use any of the following commands:

-help

--help

-h

-?

For example,

htmltools.exe -h

 

Note:

The help information showed in this command only gives you a brief usage, if you need more information, you can read this help document.

 

Back to top

 

Thank you for choosing our product.

VeryPDF HTML Converter

Web: http://www.verypdf.com

Email: support@verypdf.com