How to split long HTML and then convert HTML to PDF?

When converting HTML file to other file formats, you may meet some quite long ones which can not be converted fully no matter how hard you try. In this article, I will show you one method of converting long HTML to PDF in specified height. I use software VeryDOC DOC to Any Converter, which also can help convert HTML file to Postscript, PS, EPS, SVG, SWF, XPS, PCL, HPGL, HTML, MHTML, RTF, Text, XML, JPG, TIFF, EMF, WMF, BMP, GIF, PNG, TGA, PCX, etc. formats.

Step 1. Download DOC to Any Converter 

  • This software is Window application which can not work under Mac and Linux. But if you need this software work under Mac and Linux, please contact us then we can make one for you.
  • When downloading finishes, please unzip it to some folder then find the executable file in MS Dos Windows.

Step 2. Split HTML by height and convert HTML to PDF 

  • When you run conversion, please refer to the usage and examples.
  • Usage:   DOC2Any [options] <in-file> [<out-file>]
  • When converting HTML to PDF and split HTML by height, please refer to the following command line templates and parameters.
  • doc2any.exe –height 200 C:\in.html C:\out.pdf
    By this command line, we can convert HTML to PDF and specify height of PDF as 200.
    doc2any.exe –emfheight 150 C:\in.html C:\out.svg
    By this we can split HTML file at height of 150 and then convert HTML to SVG.
    doc2any.exe –pageheight 300 C:\in.html C:\out.tiff
    doc2any.exe –pageh 400 C:\in.html C:\out.jpg
    doc2any.exe –ph 100 C:\in.html C:\out.pdf
    Meanwhile this software also allows you to convert HTML file to other image file formats according to the height split by specified height.
    Now let us check related parameters:
    -width <int>             : Set page width to PDF file
    -height <int>            : Set page height to PDF file
    -emfheight <int>         : Split a long HTML file by height
    -pageheight <int>        : Split a long HTML page by page height, same as -emfheight
    -pageh <int>             : same as -pageheight
    -ph <int>                : same as -pageheight

So by this software, you can split HTML at any place. This function is good when converting long HTML to PDF especially there are some pictures, tables or others in HTML file. If you do not specify height, software will cut HTML in random place, so we can make sure the pictures, tables in it intact.

Meanwhile this software also can help you convert HTML to PDF and specify margins around it. There are some parameters for your reference.
-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

More functions and parameters, please check them in readme.txt. During the using, if you have any question, please contact us as soon as possible.

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

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!