Print HTML file (or URL) to PDF file and put a header text on every PDF page, Website to PDF Conversion with dynamic text contents on page header and page footer areas

I have the need to put a header on every page of a PDF that I am creating from an HTML file. I was hoping to use the tag as Internet Explorer uses.

Used your -default-header tag but got a "Result is failed. No output" error message. Am I missing something?

Also, in your readme.txt file, there is a -custom-header.

Can you tell me what names and values are allowed?

Thanks for your help.
Customer
--------------------------------------------------------------
Did some more searching on your knowledge base and found this:

https://www.verydoc.com/blog/can-i-add-page-number-to-pdf-footer-using-html2any-command-line.html

I didn't know -hfflag, -header and -footer were available since it's not in your documentation (or I couldn't find it).

Put this in but still getting the same error message. Help!

Here is my command line:

html2any -hfflag on -header "&w" "https://www.verydoc.com" "C:\mypdf.pdf"

If I remove the -hfflag and -header, it works fine. I also tried -default-header and that doesn't seem to work as well.

Thanks for your time.
Customer
--------------------------------------------------------------

Print HTML file (or URL) to PDF file and put a header text on every PDF page, Website to PDF Conversion with dynamic text contents on page header and page footer areas
No, your command line is wrong, please run following command line to try again,

html2any -hfflag on -header "&w" -printtopdf "D:\temp\mypdf.pdf" "https://www.verydoc.com"

OR

html2any -hfflag on -footer "&w" -printtopdf "D:\temp\mypdf.pdf" "https://www.verydoc.com"

If you want print HTML file to PDF file, you need use "-printtopdf" option to specify the output PDF filename, please notice this matter.

VeryDOC

Related Posts