dart_pdf
dart_pdf copied to clipboard
Scrambled text when printing PDF from some devices
Describe the bug
We are currently experiencing an issue where the text of our PDFs gets scrambled, but only when printing from specific devices.
Our app can currently output PDF files and send them to a given user's email. In some few cases users are experiencing that the text on the PDF looks scrambled when they print this file (I will attach an image of this below).
I can print it just fine from my Mac, Android and iOS devices with no issues at all, but a coworker reported that he gets the issue whenever he's printing from iPhone but not from his Mac.
Do you have any ideas of what could be causing this issue? Have you seen this issue before?
To Reproduce
We embed the font in the PDF like this:
latoItalic = pw.Font.ttf(
await rootBundle.load('assets/fonts/Lato-Italic.ttf'),
);
Screenshots
In Adobe Acrobat Reader DC under "File -> Properties -> Fonts" we can see the embedded fonts on the file.
Here you can see the scrambled text:
No idea, maybe a printer driver problem.
Hmpf... Thanks for the response, has something similar been reported before or has anyone else experienced something like this?
The printer in question would print the PDF just fine when sent from a Mac but not when sent from an iPhone. (Not sure if that was clear from the initial post)
No one experienced this. Can you try with another font?
@DavBfr I have experienced this as well when sending from an iPhone but not from mac. Just wanted to notify
@madscs11 This occurs for me too when printing with HP LASERJET PRO MFP M283fdw. On other devices, I had no issue. I am very confused why this is happening exactly. If I print the same PDF from the mail app using AirPrint it prints it out normally, but if I do it through the app with AirPrint it comes out scrambled. Any thoughts on why this might be happening?
i am facing the same problem on android device
Facing the same problem on iPhone devices. Could it be a font issue? I am using OpenSans-Regular.ttf
We ended up using another font as a workaround.
Would still be nice to be able to use all fonts, but oh well.
Yes, I was also able to fix the issue on the IPhone using the pw.ThemeData.base() as the default theme/font. It must be an issue with how the font is rendered
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
Closing this stale issue because it has no activity.