Fields Wkhtmltopdf (top and bottom)

I am using wkhtmltopdf 0.10.0 rc2 on: Linux 3.2.0-24-generiC # 38-Ubuntu x86_64 GNU / Linux

I can not create PDF files with margin-top or margin-bottom (no errors)

I use the following command:

 wkhtmotopdf -T 50 -B 50 http://google.com ./test.pdf wkhtmotopdf --margin-top 50 --margin-bottom 50 page.html ./test.pdf 

When I try this:

 wkhtmotopdf -L 50 -R 50 -T 50 -B 50 page.html ./test.pdf 

The margin on the left and right works fine (there is still no margin or margin). It doesn't matter which URL or page I'm converting.

EDIT:

This seems like a mistake. For people who still want some top-to-edge marker. Try using the header-html / footer-html function:

I just realized that the clipping problem was fixed by adding the line spacing and footer options:

wkhtmotopdf -L 50 -R 50 -T 50 -B 50 http://google.com --header-html blank.html -header-spacing 5 --footer-html blank.html --footer-spacing 5 ./test.pdf

Visit https://code.google.com/p/wkhtmltopdf/issues/detail?id=957

+6
source share

Source: https://habr.com/ru/post/917167/


All Articles