I tried to print https://kafka.apache.org/intro to a pdf file, but met some problems:

  1. I want to extract the <h1> <h2> … elements into outlines/bookmarks in the pdf file. I only know wkhtmltopdf executable can do that, by command wkhtmltopdf https://kafka.apache.org/intro intro.pdf. Printing in web browsers such as Firefox and Chrome will not create outlines in the pdf file. I was wondering if there are other ways to do that?

  2. The pdf file created by wkhtmltopdf seems to have only partial content of the webpage, and shows a (screenshotted) scroll bar in the pdf file (which is not shown in the webpage) (see screenshot below), and the scroll bar allowed only part of the content of the webpage to be printed to the pdf file. So I was wondering how to manually edit the html file, in order to remove the “scroll bar” invisible in the webpage, so that the whole content of the webpage can be printed to the pdf file? (Printing in Firefox also results in partial content of the webpage to be printed to the pdf file. Printing in Chrome will print the whole content of the web page to the pdf file, but like I mentioned earlier, it doesn’t create outlines in the pdf file.)

Thanks.

Post image



Source link

Write A Comment