Set paper size in Linux version of html2any application

I've downloaded the trial version for review. The command html2any -page-size A4 test.html test.pdf returns the following message "Result is failed. No output file is created". If I remove the "-page-size A4" option then everything works. Could you please explain what I'm doing wrong.

Customer
-----------------------------------------------
Hi,

Please find attached the HTML file that I was trying to convert (a very simple hello world example).

The file converts when the "-page-size A4" option is not specified, please see command line results below...

When the option is not specified...(including attached PDF result)

/tmp/html2any-cmd-linux/bin/html2any helloworld.html helloworld.pdf
You have 16 times to try. Please register VeryPDF HTML to Any Converter Command Line v2.0. Thanks for your support.
helloworld.html==>helloworld.pdf
result=OK

When the option is specified...

/tmp/html2any-cmd-linux/bin/html2any -page-size A4 helloworld.html helloworld.pdf
You have 17 times to try. Please register VeryPDF HTML to Any Converter Command Line v2.0. Thanks for your support.
Result is failed. No output file is created.

Regards,
Customer
-----------------------------------------------
Thanks for your message, you can use "-page-width" and "-page-height" parameters to convert HTML file to special paper size, for example,

"-page-width 612pt -page-height 792pt" will create PDF file with Letter paper size,

html2any.exe -page-width 612pt -page-height 792pt https://www.verypdf.com E:\out.pdf

"-page-width 595pt -page-height 842pt" will create PDF file with A4 paper size,

html2any.exe -page-width 612pt -page-height 792pt https://www.verypdf.com E:\out.pdf

You can use the -page-width and -page-height options to html2any to specify a size with the same aspect ratio as the page. You'll probably still have to combine this with specifying a width and height on the body, but it's useful if you want to completely fill the output PDF with content.

For reference, the 'UnitReal' accepted by the -page-width and -page-height options accept floating point values with units:

(none) == mm
mm
cm == 10mm
m  == 1000mm
didot
inch
in == inch
pica
pc == pica
cicero
pixel
px == pixel
point
pt == point

But note that they must both be specified with the same unit.

e.g.,

html2any.exe -page-width 8.5in -page-height 11in https://www.verypdf.com E:\out.pdf

html2any.exe -page-width 297mm -page-height 420mm https://www.verypdf.com E:\out.pdf

More paper sizes can be found from following web page,

https://www.verypdf.com/artprint/document-converter/index.htm

VeryPDF

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

2 Replies to “Set paper size in Linux version of html2any application

  1. Hi,

    I am looking for a shell tools to replace htmldoc.
    I am trying html2any but unlike in htmldoc (with tag), I can’t add tags to make a page break to generate a new page in the pdf file.
    Can you tell me if it is possible?

    Best regards
    Customer
    —————————————
    Please try using as follows

    //your content

    this should work.
    VeryPDF
    —————————————
    yes it works

    Thank’s a lot!

    Customer

    VN:F [1.9.20_1166]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.20_1166]
    Rating: 0 (from 0 votes)
  2. Here is what I enter to the command line,

    C:\htmltoany\html2any-cmd-windows\bin>html2any -page-size Letter -margin-left 5 -margin-right 5 procareinvoice17.html test.pdf

    Result is failed. No output file is created.

    Can you help?

    Thanks.
    Customer
    ————————————–
    please run following command line to try, the following command line does create a PDF file with Letter paper size for you,

    html2any.exe -page-width 215.9 -page-height 279.4 -margin-left 5 -margin-right 5 http://www.verypdf.com _papersize.pdf

    VeryPDF

    VN:F [1.9.20_1166]
    Rating: 5.0/5 (1 vote cast)
    VN:F [1.9.20_1166]
    Rating: 0 (from 0 votes)

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!