Problem with bwidth parameter (HTMLTools.exe)

We are currently evaluating your HTMLTools.exe commandline tool for use in our server product. We plan to convert html pages on-the-fly to pdf files.

However, we are having a very basic issue with the product. Whatever we specify with the -width or -bwidth parameter, the output does look the same. We use the htm2pdf2 switch for the new rendering.

How can we control the virtual browser window width used for rendering the page ? Let's say the converter shall use a virtual 1280 pixel screen to render the html page. What would the command line look like ?

Your help is greatly appreciated.
-htm2pdf2 switch will ignore the -bwidth and -bheight parameters, if you need use -bwidth and -bheight parameters , you may remove the -htm2pdf2 parameter to try again.


Thanks for the quick reply.

We got it to work with the -widht and -height params and htm2pdf2.

We have another question: We are migrating from converter, where we had a conditional linebreak command.  It worked like your embedded linebreak command (with a "magic word") but with an additional parameter to specify, how much room woul be needed to avoid the linebreak.  Example: <!--LINEBREAK-150--> would mean: If there at least another 150 units free of space on this page, do NOT perform a line break, otherwise DO perform a linebreak).

Do you see any possiblity to add this command to your product ? We could not live without that functionality and maybe other customers too.

Your feedback is greatly appreciated.
>>We got it to work with the -width and -height params and htm2pdf2.

Yes, -htm2pdf2 does support -width and -height parameters, but -htm2pdf2 doesn't support  -bwidth and -bheight parameters.

Yes, you can insert " magic word " into the HTML file where you want to break into the new page, please refer to the attached HTML file and following command lines,

htmltools.exe -nocenter -playemf2 -width 612 -height 792 -breakpagebytext "Break page at here" "%CD%\test.htm" "%CD%\test_keep_breakpagetext.pdf"

htmltools.exe -nocenter -playemf2 -width 612 -height 792 -delbreakpagetext -breakpagebytext "Break page at here" "%CD%\test.htm" "%CD%\test_delete_breakpagetext.pdf"

you can use -breakpagebytext parameter to break long HTML file to multi-page PDF file automatically.


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!