MaxMelcher / AzureDevOps.WikiPDFExport

Export Azure DevOps Wiki to PDF
MIT License
186 stars 62 forks source link

Body-margins when using header/footer #114

Closed Tobias-08 closed 1 year ago

Tobias-08 commented 1 year ago

Hi,

when header/footer is used the document body gets quite large margins (e. g. in the official example.pdf). This isn't the case when header/footer is off.

As the debug-html does not contain the header/footer this behaviour seems to be independent of the css and instead seems to appear in the puppeteer call? Is it possible to adjust the margins of the body?

Thanks!

MaxMelcher commented 1 year ago

Not sure if that is configurable - the header/footer options are super limited in puppeteer... Have you tried overriding the css of the main document?

Tobias-08 commented 1 year ago

Yes, but with no success. Maybe I did something wrong...

Tobias-08 commented 1 year ago

Update: Overriding in css works after all:

@page { margin-left: 1.2cm; margin-right: 1.2cm; margin-top: 1.8cm; margin-bottom: 1.8cm; }

That said: Are the MarginOptions in PDFGenerator set on purpose? Maybe an adjustment (decrease) on that side could make the css workaround obsolete.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.