Quantcast
Channel: How to convert a webpage to PDF with preserving its look (exactly as on web browser) and text/links? - Super User
Viewing all articles
Browse latest Browse all 10

Answer by SentientFlesh for How to convert a webpage to PDF with preserving its look (exactly as on web browser) and text/links?

$
0
0

I would suggest trying wkhtmltopdf again as suggested by @sebisnow in their answer, with some pre-processing.

Prior do running the program, open the developer tools (Ctrl+Shift+I), and adjust the elements that aren't sitting correctly. Likely they are responsive for phone/desktop/tablet which means that the positions are relative to other HTML objects. Make them absolute positions instead.

Edit the source of the page, focusing on the margins and padding of the objects in question. Sometimes, simply making the canvas 10-15% larger will give even relative elements enough virtual room so they do not move.

I often do use the developer tools to adjust page elements when I'm printing to PDF so I have a reference file for later. Coupled with wkhtmltopdf, you should be able to have the site appear as it does in browser with the feature's that you're looking for like image and link preservation as well as text.


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images