Page 1 of 1

How to install a new font on processmaker Editor

Posted: Fri May 24, 2019 4:09 am
by justinopsky
I need to install a new font on processmaker
so i can use it on output document editor
Thanks

Re: How to install a new font on processmaker Editor

Posted: Fri May 24, 2019 9:43 pm
by amosbatto
There is no easy to make this work if you are generating PDF files.

Here are the instructions for adding fonts in the rest of ProcessMaker:
https://www.pmusers.com/index.php/Add_f ... ocessMaker

But the only way to add a font to TCPDF which generates the PDF files is to change the source code:
https://tcpdf.org/docs/fonts/
If you want to do that, see:
viewtopic.php?f=47&t=712763

I was able to add a font, by using this HTML code in my Output Document template:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<style type = "text/css">
@font-face {
  font-family: "Crazy Killer";
  src: url("http://localhost:336/lib/fonts/Crazy-Killer.ttf");
}
p {
  font-family: "Crazy Killer";
  color: blue;
}
</style>

<head>
</head>
<body>
<p>This is test 1</p>
<h2><span style="font-family: Crazy Killer; color: green;">This is test 2 with Crazy Killer font!</span></h2>
<p style="font-family: Crazy Killer;">test 3</p>
</body>
</html>
When I have this file installed on my ProcessMaker server:
/opt/processmaker/workflow/public_html/lib/fonts/Crazy-Killer.ttf

The font appears in the Output Document template editor. However, the font doesn't appear in the PDF generated by either TCPDF or PDF2HTML. If I install the font in my computer's operating system, then it appears in the DOC file when I open it in LibreOffice. In LibreOffice, I can export the DOC file as a PDF and it will appear in the exported PDF.

If you want the font to be embedded inside the PDF so the user doesn't have to install the font in their computer's operating system, the only solution is to hack the ProcessMaker source code.

Re: How to install a new font on processmaker Editor

Posted: Mon May 27, 2019 4:30 am
by justinopsky
Thank you
I'll look into this.
The goal is for a numeric value to be inserted into the outputDocument as a barcode.