PDF pyPDFEmbedFont / webwb Cloud
Generating PDF using the OOTB PD4ML library, we are unable to embed fonts as documented.
What would be the path to use, when fonts are uploaded as binaries to webwb? In the community posts we found on this topic, we were unable to find a valid path / solution to use.
The DT pyPDFSettings offers an option to embed fonts when using HTMLToPDF, for which the directory needs to be entered, which seems to expect a local path e.g. /usr/local/...., rather than a webpath.
We saw several paths on the community, but none of the articles in the community pointed the correct location to use with cloud.
| pyPDFEmbedFont | Enables the system to embed the fonts into the PDF document from pyPDFFontsDirectory when set to true. |
| pyPDFFontsDirectory | Specifies the path to the directory with font files. |
https://support.pega.com/support-doc/troubleshooting-html-pdf-conversion-issues
https://docs-previous.pega.com/user-experience/87/generating-complex-pdfs-your-ui
@Dennis
Yes , pyPDFFontsDirectory and pyPDFPropsDirectory parameters are for server path locations if font files are stored there.But using the font files from server is not recommended way.
When using the font files using binary reference , Need to pass the definition of the font file in below format in pyCompactStylesForPDF css file if DSS UseCompactStylesForPDF is set to true.
@font-face {
font-family: "Mangal";
src: url("webwb/mangal.ttf") format("ttf");
}
If I am planning to use for paragraph tag the fonts, I will add below additional style to the css file.
p{
font-family : "Mangal";
}
Hope this helps!
Thank you.