Re: Corrupt font display on iOS when using PDF-Images with merge-fonts=true
Hello, to validate the hypothesis you could modify by hand the PDF by changing the name of the fonts in the tags /FontName and /BaseFont to a pattern used for embedded subset like A+xx (the value of xx is not important) without adding nor removing any byte from the PDF. If this solves the issue maybe a patch to font name generation is needed for embedded subsets. Best regards. Il giorno mar 16 ago 2022 alle ore 20:45 ha scritto: > Hi, > > > > If I am able to source a iOS/mac device at work, I will look into this. > > > > Thanks > > > > *From:* Mark Gibson > *Sent:* 16 August 2022 16:56 > *To:* fop-users@xmlgraphics.apache.org > *Subject:* RE: Corrupt font display on iOS when using PDF-Images with > merge-fonts=true > > > > Hi Luca > > > > We have no control over the source PDF being embedded. They are often > (but not always) exported as PDF from Excel. And done by our clients, not > us. > > > > Do we have any other options? Either via fixups to FOP or bug > notifications to iOS browsers (I’m gonna guess chromium). > > > > Thanks > > Mark > > > > *From:* Luca Bellonda > *Sent:* 16 August 2022 14:47 > *To:* fop-users@xmlgraphics.apache.org > *Subject:* Re: Corrupt font display on iOS when using PDF-Images with > merge-fonts=true > > > > [EXTERNAL] > > > > Hello the PDF is visible on Linux viewers and browsers, but the fonts are > embedded as subset in both the source PDFs and as fully embedded in the > final PDF with the fonts merged. > > The name of the font in the source pdf for example is BCDEEE+Calibri-Bold, > compatible with embedded subsets (6 chars and a plus sign). > > The name of the font in the merged file is Calibri-Bold, which should > identify it as fully embedded. > > I guess the wrong viewer is not able to deal with the character decoding, > thinking to use a fully embedded font. > > Please, try generating the source PDFs embedding the whole fonts and not a > subset. > > > > > > lb > > > > > > Il giorno mar 16 ago 2022 alle ore 13:13 Mark Gibson < > mark.gib...@staff.bluematrix.com> ha scritto: > > > > https://issues.apache.org/jira/browse/FOP-3089 > > > > Viewing in Windows browsers is fine > > Viewing in iOS browsers is corrupt > > Viewing in Adobe app on iOS and windows is fine > > Apologies, no access to Linux devices to test viewing > > > > Same issue occurs when running FOP 2.7 on Linux (CentOS) and Windows (10) > > > >
RE: Corrupt font display on iOS when using PDF-Images with merge-fonts=true
Hi, If I am able to source a iOS/mac device at work, I will look into this. Thanks From: Mark Gibson Sent: 16 August 2022 16:56 To: fop-users@xmlgraphics.apache.org Subject: RE: Corrupt font display on iOS when using PDF-Images with merge-fonts=true Hi Luca We have no control over the source PDF being embedded. They are often (but not always) exported as PDF from Excel. And done by our clients, not us. Do we have any other options? Either via fixups to FOP or bug notifications to iOS browsers (I’m gonna guess chromium). Thanks Mark From: Luca Bellonda mailto:lbello...@gmail.com> > Sent: 16 August 2022 14:47 To: fop-users@xmlgraphics.apache.org <mailto:fop-users@xmlgraphics.apache.org> Subject: Re: Corrupt font display on iOS when using PDF-Images with merge-fonts=true [EXTERNAL] Hello the PDF is visible on Linux viewers and browsers, but the fonts are embedded as subset in both the source PDFs and as fully embedded in the final PDF with the fonts merged. The name of the font in the source pdf for example is BCDEEE+Calibri-Bold, compatible with embedded subsets (6 chars and a plus sign). The name of the font in the merged file is Calibri-Bold, which should identify it as fully embedded. I guess the wrong viewer is not able to deal with the character decoding, thinking to use a fully embedded font. Please, try generating the source PDFs embedding the whole fonts and not a subset. lb Il giorno mar 16 ago 2022 alle ore 13:13 Mark Gibson mailto:mark.gib...@staff.bluematrix.com> > ha scritto: https://issues.apache.org/jira/browse/FOP-3089 Viewing in Windows browsers is fine Viewing in iOS browsers is corrupt Viewing in Adobe app on iOS and windows is fine Apologies, no access to Linux devices to test viewing Same issue occurs when running FOP 2.7 on Linux (CentOS) and Windows (10)
RE: Corrupt font display on iOS when using PDF-Images with merge-fonts=true
Hi Luca We have no control over the source PDF being embedded. They are often (but not always) exported as PDF from Excel. And done by our clients, not us. Do we have any other options? Either via fixups to FOP or bug notifications to iOS browsers (I’m gonna guess chromium). Thanks Mark From: Luca Bellonda Sent: 16 August 2022 14:47 To: fop-users@xmlgraphics.apache.org Subject: Re: Corrupt font display on iOS when using PDF-Images with merge-fonts=true [EXTERNAL] Hello the PDF is visible on Linux viewers and browsers, but the fonts are embedded as subset in both the source PDFs and as fully embedded in the final PDF with the fonts merged. The name of the font in the source pdf for example is BCDEEE+Calibri-Bold, compatible with embedded subsets (6 chars and a plus sign). The name of the font in the merged file is Calibri-Bold, which should identify it as fully embedded. I guess the wrong viewer is not able to deal with the character decoding, thinking to use a fully embedded font. Please, try generating the source PDFs embedding the whole fonts and not a subset. lb Il giorno mar 16 ago 2022 alle ore 13:13 Mark Gibson mailto:mark.gib...@staff.bluematrix.com>> ha scritto: https://issues.apache.org/jira/browse/FOP-3089 Viewing in Windows browsers is fine Viewing in iOS browsers is corrupt Viewing in Adobe app on iOS and windows is fine Apologies, no access to Linux devices to test viewing Same issue occurs when running FOP 2.7 on Linux (CentOS) and Windows (10)
Re: Corrupt font display on iOS when using PDF-Images with merge-fonts=true
Hello the PDF is visible on Linux viewers and browsers, but the fonts are embedded as subset in both the source PDFs and as fully embedded in the final PDF with the fonts merged. The name of the font in the source pdf for example is BCDEEE+Calibri-Bold, compatible with embedded subsets (6 chars and a plus sign). The name of the font in the merged file is Calibri-Bold, which should identify it as fully embedded. I guess the wrong viewer is not able to deal with the character decoding, thinking to use a fully embedded font. Please, try generating the source PDFs embedding the whole fonts and not a subset. lb Il giorno mar 16 ago 2022 alle ore 13:13 Mark Gibson < mark.gib...@staff.bluematrix.com> ha scritto: > > > https://issues.apache.org/jira/browse/FOP-3089 > > > > Viewing in Windows browsers is fine > > Viewing in iOS browsers is corrupt > > Viewing in Adobe app on iOS and windows is fine > > Apologies, no access to Linux devices to test viewing > > > > Same issue occurs when running FOP 2.7 on Linux (CentOS) and Windows (10) > > >
RE: Corrupt font display on iOS when using PDF-Images with merge-fonts=true
Thanks Simon https://issues.apache.org/jira/browse/FOP-3089 Viewing in Windows browsers is fine Viewing in iOS browsers is corrupt Viewing in Adobe app on iOS and windows is fine Apologies, no access to Linux devices to test viewing Same issue occurs when running FOP 2.7 on Linux (CentOS) and Windows (10) Thanks Mark From: Simon Steiner Sent: 16 August 2022 10:55 To: fop-users@xmlgraphics.apache.org Subject: RE: Corrupt font display on iOS when using PDF-Images with merge-fonts=true [EXTERNAL] Hi, Can you open a bug on jira, can you replicate on windows or linux pdf viewers? Thanks From: Mark Gibson mailto:mark.gib...@staff.bluematrix.com>> Sent: 15 August 2022 18:18 To: fop-users@xmlgraphics.apache.org<mailto:fop-users@xmlgraphics.apache.org> Subject: Corrupt font display on iOS when using PDF-Images with merge-fonts=true Hi We have an issue when using PDF-Images plugin to inject a PDF as an image. All PDFs are rendered with fonts embedded. When we set merge-fonts config to false, the rendered PDF displays fine in all tested viewers However, when we set merge-fonts config to true, the rendered PDF is corrupt when viewed in-browser on IOS devices (currently tested browsers include Safari, Chrome, and DuckDuckGo, latest IOS and browsers). Strangely, when viewed in Adobe iOS app, the PDF is displayed fine. The corruption is in the font display, making embedded textual tables unreadable. I don't know enough about PDF + fonts + viewers to be able to figure out if there's a universal iOS PDF in-browser viewer error, or whether the merge-fonts process somehow corrupts the resultant PDF (in a weird way that means some viewers work, whilst some don't) Adobe Acrobat Pro DC file comparison shows zero differences between the two rendered PDFs. I've attempted to attach a zip containing the fo, embedded pdf, two fop configs, and the two fonts in use. Hopefully it won't be stripped Commands to render the two PDFs are as follows (run from the root directory of the attached archive): * .../fop.bat -fo pdf-images.fo -c fop.xml -pdf pdf-images.pdf * .../fop.bat -fo pdf-images.fo -c fop-mergefonts.xml -pdf pdf-images-mergefonts.pdf Hopefully someone will at least be able to give some direction for this. The merge-fonts config is a game changer for us as it massively shrinks the size of many of the PDFs we render. Thanks Mark
RE: Corrupt font display on iOS when using PDF-Images with merge-fonts=true
Hi, Can you open a bug on jira, can you replicate on windows or linux pdf viewers? Thanks From: Mark Gibson Sent: 15 August 2022 18:18 To: fop-users@xmlgraphics.apache.org Subject: Corrupt font display on iOS when using PDF-Images with merge-fonts=true Hi We have an issue when using PDF-Images plugin to inject a PDF as an image. All PDFs are rendered with fonts embedded. When we set merge-fonts config to false, the rendered PDF displays fine in all tested viewers However, when we set merge-fonts config to true, the rendered PDF is corrupt when viewed in-browser on IOS devices (currently tested browsers include Safari, Chrome, and DuckDuckGo, latest IOS and browsers). Strangely, when viewed in Adobe iOS app, the PDF is displayed fine. The corruption is in the font display, making embedded textual tables unreadable. I don't know enough about PDF + fonts + viewers to be able to figure out if there's a universal iOS PDF in-browser viewer error, or whether the merge-fonts process somehow corrupts the resultant PDF (in a weird way that means some viewers work, whilst some don't) Adobe Acrobat Pro DC file comparison shows zero differences between the two rendered PDFs. I've attempted to attach a zip containing the fo, embedded pdf, two fop configs, and the two fonts in use. Hopefully it won't be stripped Commands to render the two PDFs are as follows (run from the root directory of the attached archive): * ./fop.bat -fo pdf-images.fo -c fop.xml -pdf pdf-images.pdf * ./fop.bat -fo pdf-images.fo -c fop-mergefonts.xml -pdf pdf-images-mergefonts.pdf Hopefully someone will at least be able to give some direction for this. The merge-fonts config is a game changer for us as it massively shrinks the size of many of the PDFs we render. Thanks Mark