elliotblackburn/mdpdf

Margins are not respected (--border options)

brunetton opened this issue · 1 comments

Hi,
First of all: Thanks for this great tool ! It's exactly what I was looking for ! ❤️

I'm trying to adjust margins of a generated document but the margins I give are not respected. Here are used commands and measured left margins in mm:

  • mdpdf test.md => 21.9 (no problem here as default margins is 20, there's probably a little margin due to CSS)
  • mdpdf test.md --border=20 => 7.5
  • mdpdf test.md --border=50 => 15
  • mdpdf test.md --border=75 => 22
  • mdpdf test.md --border=100 => 29
  • mdpdf test.md --border=150 => 41

The factor between asked border and effective border seems to be around 3.3, except for --border=20 where it's around 2.6. This is quite strange and not really ideal to use ;)

Steps to reproduce

  • create a test.md file containing:
    # Test page
    
    Adipisicing veniam eu laborum esse sit. Reprehenderit sunt adipisicing culpa labore eiusmod voluptate enim Lorem fugiat duis. Anim Lorem voluptate duis qui.
    
  • generate corresponding PDF file using mdpdf only using --border options
  • use Inkscape PDF functionality to mesure effective generated margins

mdpdf 3.0.1

Thanks for your time

Sorry for taking so long to get to this. Unfortunately those border values are consumed by puppeteer and we don't really touch them. I'd suggest raising this with them if you think the values aren't popping out as they should be. I wish I could be more help here!