SF
Asked
Hi,
What file I need to edit to change the font of the generated PDF on sales ?
I have the code just need to know which file.
BR.
What file I need to edit to change the font of the generated PDF on sales ?
I have the code just need to know which file.
BR.
- MSAnsweredHello,
All the view files are `themes/default/admin/views/xxxxx/pdf.php`, please replace `xxxxx` with the modules such as sales, quotes and purchases. The sales pdf view file would be `themes/default/admin/views/sales/pdf.php`
Thank you - SFAnsweredGreat
I inserted the code
```
<style>
@font-face {
font-family: "Segoe UI";
font-weight: 300;
src: local("Segoe UI Semilight"), local("Segoe UI");
}
body {
font-family: Segoe UI, Dejavu Sans, Helvetica Neue, Arial, sans-serif;
}
</style>
```
before line 10 but nothing actually happened , do I need to change >styles/pdf/pdf.css ?
BR. - MSAnsweredMay I know pdf library are you using. You can try both `dompdf` & `mpdf` to check. It's might be font loading issue but I will try to check after your test with both.
Thank you - SFAnsweredNice point, I am using mPDF, when I switch to dompdf I see the font is what I want but since it is Arabic letters it is being written backward, so here only mPDF solved the problem. but with mPDF the font still the old font not the one I want.
Thanks. - MSAnsweredAdding custom fonts to pdf involves extra coding. I am referring you to the guide below
**For mPDF**: Library file path is `app/libraries/Tec_mpdf.php` and docs link is [https://mpdf.github.io/fonts-languages/fonts-in-mpdf-7-x.html](https://mpdf.github.io/fonts-languages/fonts-in-mpdf-7-x.html)
**For dompdf**: Library file path is `app/libraries/Tec_dompdf.php` and docs link is [https://github.com/dompdf/dompdf/wiki/UnicodeHowTo](https://github.com/dompdf/dompdf/wiki/UnicodeHowTo) - SFAnsweredHi,
Shall I open a ticket for that ?
BR. - MSAnsweredHello,
I am sorry as that can't be done in 10 minutes. May I know your preferred library to provide estimate.
Thanks - SFAnsweredHi,
app/libraries/Tec_mpdf.php
I want the font to be Segoe UI Semilight
Thanks - MSAnsweredHello,
For mPDF, the ticket would be fine. Please [open the ticket](/support/tickets/new) with details and don't forget to attach the font file.
Thank you - Login to Reply