[Solved] Export to PDF generates different characters

Issues installing under the Mac OSX - X11 - Aqua
Locked
nicoda
Posts: 7
Joined: Tue Nov 21, 2023 12:44 pm

[Solved] Export to PDF generates different characters

Post by nicoda »

Hello,
I've been reading some threads with similar problems, notably here and here. But every case has its specifics, which is why I still need some help here.
I'm using a Braille character which displays normally in OO Writer, but changes to other special charaters in PDFs generated through the "Export to pdf" option. The displayed character in the PDF depends on the font used in Writer (see bellow the example PDF showing the result with different fonts).
As suggested by John_Ha in the thread upstairs, I believe this is due to the lack of the appropriate Braille charater in the font used to generate the PDF through the "Export to PDF" option. Interestingly, the right charater is properly displayed when using a different method to generate the pdf: through the Print document option. In this case, the PDF is generated by the Mac OS instead of OO.
As the character is correctly displayed in the Wrinter window and in PDFs generated through the "Print" option, this is not a problem due to the absence of the proper font or a workable alternative font installed in the system. It seems related to how OO choses the font specifically when exporting to PDF.
Why would OO use a different set of fonts to generate a PDF than when displaying in the Writer (I had no such problem with OO v.3 in my older Mac), or than used natively in Mac OS? How do I solve that?

In attachment:

PDF 1: generated through the "Print" option, displaying the right Braille charater with the different fonts used.
PDF 2: generated through the "Export to PDF" option, showing the resulting character displayed.

Thanks in advance.
PDF 2.pdf
(41.68 KiB) Downloaded 219 times
PDF 1.pdf
(34.44 KiB) Downloaded 254 times
Last edited by Hagar Delest on Tue Nov 21, 2023 7:31 pm, edited 1 time in total.
OpenOffice 4.1
Mac OS 14.1 (Intel)
User avatar
Hagar Delest
Moderator
Posts: 32668
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Export to PDF generates different charaters

Post by Hagar Delest »

In the first case, I see an AppleBraille font that may be not available to AOO:
Fonts.png
Fonts.png (5.71 KiB) Viewed 2428 times
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
nicoda
Posts: 7
Joined: Tue Nov 21, 2023 12:44 pm

Re: Export to PDF generates different charaters

Post by nicoda »

Hi Hagar,
Where is this window from?
The point is that AOO generates the character properly in the Writer window. So it somehow has access to it.
OpenOffice 4.1
Mac OS 14.1 (Intel)
User avatar
MrProgrammer
Moderator
Posts: 4909
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Export to PDF generates different charaters

Post by MrProgrammer »

Hagar Delest wrote: Tue Nov 21, 2023 4:15 pm In the first case, I see an AppleBraille font that may be not available to AOO:
The font is available in Writer on my MacOS system. This is OpenOffice 4.1.7 on MacOS 13.6.

nicoda wrote: Tue Nov 21, 2023 3:21 pm I'm using a Braille character which displays normally in OO Writer, but changes to other special charaters in PDFs generated through the "Export to pdf" option.
Using font Apple Braille for the Braille characters, both File → Export to PDF and File → Print → Save as PDF display correctly when I later open the PDF with Preview.
Font setting for text
Font setting for text
202311210836.gif (50.09 KiB) Viewed 2392 times
202311210836A.pdf
File → Export as PDF
(8.43 KiB) Downloaded 227 times
202311210836M.pdf
File → Print → Save as PDF
(8.72 KiB) Downloaded 249 times
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
nicoda
Posts: 7
Joined: Tue Nov 21, 2023 12:44 pm

Re: Export to PDF generates different charaters

Post by nicoda »

Hi MrProgrammer,
Changing font to Apple Braille works, but it changes the the rendering of the character and the output is a bit uggly (see bellow the 2 versions, before exporting to PDF).
Capture d’écran 2023-11-21 à 15.55.27.png
Capture d’écran 2023-11-21 à 15.55.27.png (26.84 KiB) Viewed 2383 times
OpenOffice 4.1
Mac OS 14.1 (Intel)
User avatar
Hagar Delest
Moderator
Posts: 32668
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Export to PDF generates different charaters

Post by Hagar Delest »

nicoda wrote: Tue Nov 21, 2023 4:27 pm Where is this window from?
It is the fonts properties of your PDF 1 file. it is the first place to check with such issues.
You can also see that there is no such font in your PDF 2 file. Thus, Writer fails to embed the correct characters.
As to why...
Maybe a licensing problem with the Apple Braille no allowing third parties to use it?
Have you tried to install another braille font?
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
nicoda
Posts: 7
Joined: Tue Nov 21, 2023 12:44 pm

Re: Export to PDF generates different charaters

Post by nicoda »

Interesting indeed.
No, I did not try to install other braille fonts. Instead, I followed you suggestion in this thread, I switched to LibreOffice and it works just fine, as it usually did in earlier versions of AOO. It generates PDFs with the right characters directly from LO.
Confusing is the fact that the very same Apple Braille font renders differently in AOO and in AOO generated PDFs, as shown in my previous post. This is all mysterious...

Thanks for your help. Still no proper solution, but some workarounds.
OpenOffice 4.1
Mac OS 14.1 (Intel)
User avatar
Hagar Delest
Moderator
Posts: 32668
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Export to PDF generates different charaters

Post by Hagar Delest »

Right, that's why we end up advising the switch to LO. New AOO releases seem to bring regressions or lack of support with new features in the modern OS's perhaps.

I've tagged your topic as solved, feel free to change that if you would like to have further investigation by other users.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
Bill
Volunteer
Posts: 8934
Joined: Sat Nov 24, 2007 6:48 am

Re: Export to PDF generates different charaters

Post by Bill »

nicoda wrote: Tue Nov 21, 2023 6:57 pm ... I did not try to install other braille fonts.
Try the DejaVu Serif font if it's installed. The DejaVu fonts should have been installed by AOO. They have the Braille Patterns Unicode block.
AOO 4.1.14 on Ubuntu MATE 22.04
User avatar
MrProgrammer
Moderator
Posts: 4909
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: [Solved] Export to PDF generates different charaters

Post by MrProgrammer »

This PDF is produced with Writer, File → Export to PDF. On my Mac all the Braille characters seem fine.
Screen image of PDF as displayed by Preview
Screen image of PDF as displayed by Preview
202311221012.gif (42.08 KiB) Viewed 1873 times
202311221012.odt
(17.07 KiB) Downloaded 224 times
202311221012.pdf
(43.24 KiB) Downloaded 233 times

nicoda wrote: Tue Nov 21, 2023 3:21 pm It seems related to how OO choses the font specifically when exporting to PDF.
Another possibility is that the PDF viewer chooses a replacement font when the character to be displayed is not present in the font which was set when the PDF was created. This makes good sense; how can Writer possibly know what fonts will be available when the PDF is displayed? Perhaps it's being displayed on a different computer. Only the PDF viewer can know what fonts are available then the PDF is opened. I have never seen any documentation which explains how font replacement is done. The safe procedure is to select fonts which are known to contain the characters in the document. Apple's Font Book utility shows that neither Arial nor Helvetica contains the Braille characters but DejaVu Serif does.

nicoda wrote: Tue Nov 21, 2023 4:59 pm Hi MrProgrammer,
Changing font to Apple Braille works, but it changes the the rendering of the character and the output is a bit uggly.
The Apple Braille font contains only the Braille characters. Thus a replacement font must be used for anything else. Perhaps that is why the characters are ugly. I suggest using Apple Braille font only for Braille characters, as I have done.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Locked