dart_pdf icon indicating copy to clipboard operation
dart_pdf copied to clipboard

Scrambled text when printing PDF from some devices

Open madscs11 opened this issue 4 years ago • 9 comments

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.

image

Here you can see the scrambled text:

image

madscs11 avatar Feb 24 '21 10:02 madscs11

No idea, maybe a printer driver problem.

DavBfr avatar Feb 27 '21 13:02 DavBfr

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)

madscs11 avatar Mar 01 '21 09:03 madscs11

No one experienced this. Can you try with another font?

DavBfr avatar Mar 01 '21 11:03 DavBfr

@DavBfr I have experienced this as well when sending from an iPhone but not from mac. Just wanted to notify

AllinGaming avatar Apr 24 '21 20:04 AllinGaming

@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?

AllinGaming avatar May 07 '21 08:05 AllinGaming

i am facing the same problem on android device

Abdallah-al-hallak avatar Nov 20 '21 12:11 Abdallah-al-hallak

Facing the same problem on iPhone devices. Could it be a font issue? I am using OpenSans-Regular.ttf

RichardSV15 avatar Mar 08 '22 15:03 RichardSV15

We ended up using another font as a workaround.

Would still be nice to be able to use all fonts, but oh well.

madscs11 avatar Mar 08 '22 15:03 madscs11

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

RichardSV15 avatar Mar 09 '22 14:03 RichardSV15

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

github-actions[bot] avatar Apr 16 '23 00:04 github-actions[bot]

Closing this stale issue because it has no activity.

github-actions[bot] avatar Apr 22 '23 00:04 github-actions[bot]