-
-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Font 'Verdana' not flowing correctly, When generate PDF #739
Comments
Does this use the same reportlab version for both cases? |
yes |
Hi, |
@Denny814, am I right in guessing the first example was not generated by xhtml2pdf or reportlab, but by a browser? The second example looks very much like it rendered using the default sans-serif font. That also makes sense, since Verdana is not a standard PDF font you will have to provide it to xhtml2pdf in form of a ttf file: One non-technical reminder: it seems Verdana is not a "free" font, i.e. it is probably illegal to use it without a license unless you run the process on Windows. You might want to check if there's a free look-alike alternative. |
Below is my Python File:
with open(output_filename, 'wb') as output_file:
result = pisa.CreatePDF(
src=html_content,
dest=output_file,
)
if result.err:
print(f"PDF creation error: {result.err}")
else:
print("PDF created successfully")
Below is my html_content File:
<title></title> <style> body { font-family: 'Verdana', sans-serif; } </style> This is Verdana Font. Quarter basis distribution.I have attached file for Actual Verdana font look and feel and xhtml2pdf generated file.
1st is the ACtual Verdana Font and 2nd is the xhtml2pdf generated font.
OS version:
Python version: 3.11.4
XHTML2PDF version: 0.2.13
The text was updated successfully, but these errors were encountered: