How to use the command line version of CHM to PDF Converter?

VeryPDF CHM to PDF Converter can run well under both Windows and Mac systems. A command line version is provided, and you can get this CMD version for free when purchase this software application. This article shows how to use the command line version of VeryPDF CHM to PDF Converter.

The following are the basic usage and options:

chm2pdf [options] <input file> <output file>

Options:

----------------------Set page range-------------------------

The first three options are used to select the pages to convert from CHM to PDF.

  •  -chp <int/int/int..> : Select a CHM chapter to convert to PDF. For instance, the following one can extract the first section of chapter two from the original CHM.

chm2pdf -chp 2/1 input.chm output.pdf

  • -chpft <int/...> <int/...> : Select a chapter or section range to convert. The chapters or sections must be under the same node. The first example below is an proper example, while the second one below is an inappropriate example.

chm2pdf -chpft 2/1 2/3 input.chm  output.pdf  ----DO
chm2pdf -chpft 2/1 5/2 input.chm output.pdf   ----DON’T

  • -pgft <int> <int>: Select a page range to convert. No bookmark will be generated. For example, the command line below can extract pages from 1 to 25 from CHM to PDF. The first number after -pgft presents the beginning page, and the second number presents the last page.

chm2pdf -pgft 1 25 input.chm output.pdf

----------------------Set page margin-------------------------

The following four options are used to set page margins for the output PDF file.                                                                                                                                                       

  • -B  <num unit> : Set the page bottom margin (mm/cm/in/pt,  default 10 mm).                                                                                                                                                          
  • -L  <num unit> : Set the page left margin (mm/cm/in/pt, default 10 mm).
  • -R  <num unit> : Set the page right margin (mm/cm/in/pt, default 10 mm).
  • -T  <num unit> : Set the page top margin (mm/cm/in/pt, default 10 mm).

For example,

chm2pdf -L 100 pt -R 60 pt -T 100 pt –B 50 pt input.chm output.pdf
chm2pdf -R 6 cm input.chm output.pdf
chm2pdf -T 100 mm input.chm output.pdf

----------------------Set page orientation-------------------------

The following one can be used to set page orientation.

  • -O  <string> : It has two values: Landscape and Portrait. The default value is Portrait. For example,

chm2pdf -O Landscape input.chm output.pdf

----------------------Set page size -------------------------

The following are to set page size of the output file

  • -s  <string>                       : Set paper size (A4/A3/Letter/Legal/etc. Default A4).
  •  -h  <num unit>                 : Set page height (mm/cm/in/pt, default unit mm). -h and -w must be used together.
  •  -w  <num unit>                : Set page width (mm/cm/in/pt, default unit mm).

For example,

chm2pdf -s Letter input.chm  output.pdf
chm2pdf-h 7 in -w 6 in input.chm output.pdf  

The following table shows some common page sizes:

pdf page size

pdf page size

pdf page size

pdf page size

Please view the comparison between different page sizes:

pdf page size pdf page size

----------------------Other options-------------------------

  • -g                                     : Generate PDF in grayscale. If you want to generate grey scale PDF, you can use this option.
  •  -l                                      : Generate low quality PDF.If you want to reduce the file size of the result PDF file, this option may be helpful.
  • -z <float>                         : Zoom in or zoom out (default 1). For example,

chm2pdf -z 4 input.chm output.pdf
chm2pdf -z 0.5 input.chm output.pdf  

  • -$ <regcode>                    : Register with a registration code. For example,

chm2pdf -$ jjdttifffedd input.chm output.pdf

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

Related Posts

This entry was posted in @VeryPDF News, CHM to PDF Converter, Promotion 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!