Open alicescfernandes opened 3 years ago
I was just hit by this void of information and thankfully found this issue giving me a bit more information and context. More elaborate documentation in the PDF + custom theme area would be highly appreciated for sure!
I've been trying to make my theme more print friendly and came across this issue. Having played with it a bit my observations are
pdfViewport
is in the wrong place.resume-cli
expects it to be at the root level of the exports and it uses it to setViewPort
on the page e.g.
module.exports = {
render: render,
pdfViewPort: { ... },
pdfOptions: { ... }
}
pdfViewPort
/setViewPort
doesn't actual have the expected effect. https://stackoverflow.com/questions/59951399/puppeteer-viewport-settings-having-no-effect-when-creating-pdfpdfOptions
and clear format
(which is defaulted in resume-cli to letter
) as this overrides width
/height
e.g.
module.exports = {
...
pdfOptions: {
width: "1200px",
height: "1692px", // A4 ratio
format: undefined
}
}
Hi! This is not an issue per se, but the docs also don't mention how to develop themes. While trying to debug some rendering issues on puppeteer, i came across a way to customize rendering. By default,
resume-cli
will render a PDF with in letter format. In Europe we use A4 paper. Also, resume-cli doesn't respect@ media print
rules. This can be changed by settingmediaType: 'print'
on thepdfRenderOptions
In order to customize the rendering options, you need to export a
pdfRenderOptions
on theindex.js
of the theme. I believe that this only works for local themes thoughExample code
The PDF options that puppeteer accepts on
page.pdf
are also accepted by theresume-cli
. You can check available PDF options hereIs there anyway that we can develop some sort of documentation for theme developers? I would be willing to work on that