AzureDevOps.WikiPDFExport icon indicating copy to clipboard operation
AzureDevOps.WikiPDFExport copied to clipboard

Body-margins when using header/footer

Open Tobias-08 opened this issue 3 years ago • 3 comments

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!

Tobias-08 avatar Jul 18 '22 08:07 Tobias-08

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?

MaxMelcher avatar Jul 18 '22 12:07 MaxMelcher

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

Tobias-08 avatar Jul 18 '22 13:07 Tobias-08

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.

Tobias-08 avatar Jul 19 '22 05:07 Tobias-08

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.

stale[bot] avatar Sep 20 '22 15:09 stale[bot]