Text encoding issues when saving report as PDF

smeaGOLLsmeaGOLL Member Posts: 3
edited 2022-12-07 in NAV Three Tier
Hi, Hope some one can help.

I have a customer that sends pay slips to it's employees as PDF. Their employees have been issued Android phones and most of them only view their pay slip on that phone.

The system that they send it through in Denmark charges pr kb so to reduce the size of the PDF i have disabled PDFFontEmbedding in the report. This reduces the file size from 180 kb to just 8 kb. Nice.

But this creates a major issue as now any line containing local characters, æøå, gets scrambled when opening the file on Android.

cab3iktsfxut.jpg

To compare this is what the lines looks line on pc. Sorry about the mismatched font, have tried some random solutions in between the two files. But it also clearly highlights that there is some issue with the encoding on those lines.

nfa7kzmb27p1.png

Answers

  • vaprogvaprog Member Posts: 1,116
    edited 2022-12-07
    What happens wen you view the document on an iOS device or on a PC which does not have the font you used in the document installed on the system?

    What method do you use to generate the documents? REPORT.SAVEASPDF?

    I would think there are two possible causes:
    1. The PDF file is created incorrectly --> there is not much you can do, other than updating respective components.
    2. The app that renders the document on Android is bad. --> try to update or switch to another one

    You can try to use a different font (font name) when generating the document. I suggest you use one of the standard postscript ones. Most systems / viewers will have font substitutions for these if the font is not installed anyway. Best bet is Helvetica (as the NAV classic report designer defaulted to).
  • smeaGOLLsmeaGOLL Member Posts: 3
    edited 2022-12-08
    vaprog wrote: »
    What happens wen you view the document on an iOS device or on a PC which does not have the font you used in the document installed on the system?

    Tested on PC with Adobe Reader. There it only shows dots intead of the problem lines.
    vaprog wrote: »
    What method do you use to generate the documents? REPORT.SAVEASPDF?

    When it is run normally I use REPORT.SAVEASPDF but during testing i have just run the report and chosen to save as pdf instead of printing.
    vaprog wrote: »
    You can try to use a different font (font name) when generating the document. I suggest you use one of the standard postscript ones. Most systems / viewers will have font substitutions for these if the font is not installed anyway. Best bet is Helvetica (as the NAV classic report designer defaulted to).

    Do you have any suggestions for this? I have tried Arial, Roboto and Courier and none of these worked. Helvetica is a paid font so we are trying to avoid it.
  • vaprogvaprog Member Posts: 1,116
    Looks like the document is at fault, not Android, or the Android app. As the PDF is generated by Microsoft report Server components, update those if possible.

    Other options might be
    • leave the font in and live with the additional size.
    • use a PDF printer which you can control and configure as needed
    • post-process the PDF document
Sign In or Register to comment.