MaxMelcher / AzureDevOps.WikiPDFExport

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

Setting the height of the Header from HeaderTemplate #138

Closed JohnnyUndercover closed 1 year ago

JohnnyUndercover commented 1 year ago

Hey,

when i set a height for the header using the header template, the header element in the PDF gets bigger, but the body still starts at the same place. I.e. there is then an overlap between header and body.

When I create a header template that uses 80px as height, I get the following result: grafik

The header area (purple) and the body area (green) overlap. Above the header there is also a space of 20px. This limits the usable space to 60px. Also the height of the header is not exactly taken over. Instead of 80px the header has a height of 107px. I tried it with different heights and found that the height of the header increases relatively consistently by 1.34 times. (But why?)

I would have expected the header to grow with the height of the header-template. Am i missing something?

These are the Filese and commands i used to create the pdf:

My Markdown File Demo.md

# DEMO

header template
`
<div style='-webkit-print-color-adjust: exact; width: 100%; height:80px; background-color: blueviolet;'>
</div>
`

My .order file

Demo

My css file default.css

body,
html {
    color: #191919;
    word-wrap: break-word;
    font-family: "Segoe UI Emoji", Symbola, Tahoma, Geneva, Verdana, sans-serif;
    font-size: .9375rem;
    background-color: #D2F9D2;
}

html>*:first-child {
    margin-top: 0
}

html>*:last-child {
    margin-bottom: 0
}

My header-template header.html

<div style='-webkit-print-color-adjust: exact; width: 100%; height:80px; background-color: blueviolet;'>
</div>

Command used with the follwowing parameters:

azuredevops-export-wiki.exe --css "C:\temp\test_wikiToPdf\.wiki2pdf\default.css"  --header-template-path "C:\temp\test_wikiToPdf\.wiki2pdf\header.html" --output "C:\temp\test_wikiToPdf\mypdf.pdf" --open
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.