Re: Font names using multi-byte strings
Luca Bellonda <[email protected]> Wed, 28 Jan 2026 14:20:01 +0100
| Newsgroups | gmane.text.xml.fop.user |
|---|---|
| Message-ID | <CAK+9=OYG6f-LPd8V80xysbWUp=j05Orzb=qyRm1Fif6XrkDNrQ@mail.gmail.com> |
--0000000000008e4efa064972993e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The ISO 32000-1 standard for PDF 1.7 (available free of charge from Adobe) in paragraph 7.3.5, page 18, states that the Name object, in some situations, can interpret numeric bytes as part of a UTF-8 string. There is also a note on Unicode normalization. Accepting all non-illegal characters and converting them to a UTF-8 sequence would likely be correct, even without generating warnings. Il Mar 27 Gen 2026, 22:23 Joao Andre Goncalves < [email protected]> ha scritto: > I was able to get a valid PDF by removing the 8-bit restriction, but the > font name becomes gibberish. I spent some time looking for why we have su= ch > restriction and the only thing I found was the following: > > https://api.itextpdf.com/iText5/java/5.5.11/index.html?com/itextpdf/text/= pdf/PdfName.html#:~:text=3DClass%20PdfName&text=3DPdfName%20is%20an%20objec= t%20that,(page%2056-58) > > When I went into the Manual mentioned I did not manage to find a reason > for the restriction. I also tried to create a font with the same font nam= e > as the one in your PDF but FontForge had a similar restriction to FOP > (ASCII characters only and not the escaped characters). > > I'm not sure if we should be changing FOP until we determine how the > original font was created. If we do change FOP, we could change the > exception to a warning but I'm not sure what else could be impacted by th= is > change. > > > Thanks > > -----Original Message----- > From: Mark Gibson <[email protected]> > Sent: 23 January 2026 09:03 > To: [email protected] > Subject: RE: Font names using multi-byte strings > > Thanks Chris. > > Attached is the only example we have, and have knowingly seen. And we've > been working with Japanese clients for years now. > > > Mark > > -----Original Message----- > From: Chris Bowditch <[email protected]> > Sent: 23 January 2026 14:44 > To: [email protected] > Subject: Re: Font names using multi-byte strings > > [EXTERNAL] > > Hi Mark, > > Are you able to attach your PDF so we can replicate this? > > Thanks, > > Chris > > On 15/01/2026 17:09, Mark Gibson wrote: > > > > Hi, > > > > I thought I=E2=80=99d just poll the community on this one, as I can=E2= =80=99t see it > > reported anywhere. > > > > We have a PDF that lists its fonts using Japanese characters (in this > > case, it=E2=80=99s MS Gothic and MS PGothic, where =E2=80=9CGothic=E2= =80=9D actually is in > > Japanese characters). > > > > When trying to import that image using fo:external-graphic > > (fop-pdf-images.jar), we get an exception with the message =E2=80=9COnl= y 8-bit > > characters allowed by this implementation=E2=80=9D. > > > > In reviewing FOP code, org.apache.fop.pdf.PDFName.toHex() throws this > > exception if the character id is > 256. > > > > Does this mean FOP cannot handle cases where the names of PDF records > > are not in simple ascii range? > > > > Caused by: java.lang.IllegalArgumentException: Only 8-bit characters > > allowed by this implementation > > > > at org.apache.fop.pdf.PDFName.toHex(PDFName.java:78) > > > > at org.apache.fop.pdf.PDFName.escapeName(PDFName.java:64) > > > > at org.apache.fop.pdf.PDFName.<init>(PDFName.java:42) > > > > at > > org.apache.fop.render.pdf.pdfbox.PDFCloner.cloneForNewDocument(PDFClon > > er.java:106) > > > > at > > org.apache.fop.render.pdf.pdfbox.PDFCloner.readCOSDictionary(PDFCloner > > .java:154) > > > > at > > org.apache.fop.render.pdf.pdfbox.PDFCloner.cloneForNewDocument(PDFClon > > er.java:104) > > > > at > > org.apache.fop.render.pdf.pdfbox.PDFCloner.readCOSObject(PDFCloner.jav > > a:134) > > > > at > > org.apache.fop.render.pdf.pdfbox.PDFCloner.cloneForNewDocument(PDFClon > > er.java:84) > > > > at > > org.apache.fop.render.pdf.pdfbox.PDFCloner.readCOSDictionary(PDFCloner > > .java:154) > > > > at > > org.apache.fop.render.pdf.pdfbox.PDFCloner.cloneForNewDocument(PDFClon > > er.java:104) > > > > at > > org.apache.fop.render.pdf.pdfbox.PDFCloner.readCOSDictionary(PDFCloner > > .java:154) > > > > at > > org.apache.fop.render.pdf.pdfbox.PDFCloner.cloneForNewDocument(PDFClon > > er.java:104) > > > > at > > org.apache.fop.render.pdf.pdfbox.PDFBoxAdapter.cloneForNewDocument(PDF > > BoxAdapter.java:141) > > > > at > > org.apache.fop.render.pdf.pdfbox.PDFBoxAdapter.createStreamFromPDFBoxP > > age(PDFBoxAdapter.java:212) > > > > at > > org.apache.fop.render.pdf.pdfbox.AbstractPDFBoxHandler.createStreamFor > > PDF(AbstractPDFBoxHandler.java:111) > > > > at > > org.apache.fop.render.pdf.pdfbox.PDFBoxImageHandler.handleImage(PDFBox > > ImageHandler.java:77) > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > ________________________________ > Joao Andre Goncalves > Customer Developer > > t | m 07733161880 > [email protected] > smartcommunications.com<https://www.smartcommunications.com/> > > [ > https://www.smartcommunications.com/wp-content/uploads/025_Trends2026-450= x160_v1.jpg > ]< > https://scale.smartcommunications.com/2026-Trends-White-Paper.html?utm_so= urce=3Doutlook&utm_medium=3Demail&utm_campaign=3Dwc-global-2026-white-paper= -2026-trends > > > > Explore the new era of AI-powered customer engagement. Get your copy of > the 2026 Trends Report now.< > https://scale.smartcommunications.com/2026-Trends-White-Paper.html?utm_so= urce=3Doutlook&utm_medium=3Demail&utm_campaign=3Dwc-global-2026-white-paper= -2026-trends> > Smart Communications is a trading name of SmartComms SC Limited which is > registered in England under No. 4303041 whose registered office is at Sui= te > 23, LCLB, 95 Mortimer Street, London, W1W 7GB. Please consider the > environment before printing. The contents of this e-mail are intended for > the named addressee only. It contains confidential information. Unless yo= u > are the named addressee or an authorized designee, you may not copy or us= e > it, or disclose it to anyone else. If you received it in error please > notify us immediately and then destroy it. Smart Communications will > process your data as described in the Smart Communications' External > Privacy Policy.< > https://www.smartcommunications.com/external-privacy-policy/> > > Follow us on LinkedIn,<https://www.linkedin.com/company/15166060/admin/> > YouTube,<https://www.youtube.com/@Smart_Communications/> and X.< > https://x.com/ccminnovators?lang=3Den> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --0000000000008e4efa064972993e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto"><div dir=3D"auto">The ISO 32000-1 standard for PDF 1.7 (a= vailable free of charge from Adobe) in paragraph 7.3.5, page 18, states tha= t the Name object, in some situations, can interpret numeric bytes as part = of a UTF-8 string. There is also a note on Unicode normalization.</div><div= dir=3D"auto"><br></div><div dir=3D"auto">Accepting all non-illegal charact= ers and converting them to a UTF-8 sequence would likely be correct, even w= ithout generating warnings.=C2=A0</div></div><br><div class=3D"gmail_quote = gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">Il Mar 27 Gen = 2026, 22:23 Joao Andre Goncalves <<a href=3D"mailto:JGoncalves@smartcomm= unications.com">[email protected]</a>> ha scritto:<br><= /div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bo= rder-left:1px solid rgb(204,204,204);padding-left:1ex">I was able to get a = valid PDF by removing the 8-bit restriction, but the font name becomes gibb= erish. I spent some time looking for why we have such restriction and the o= nly thing I found was the following:<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 <a href=3D"https://api.itextpdf.com/iText5/java= /5.5.11/index.html?com/itextpdf/text/pdf/PdfName.html#:~:text=3DClass%20Pdf= Name&text=3DPdfName%20is%20an%20object%20that,(page%2056-58)" rel=3D"no= referrer noreferrer" target=3D"_blank">https://api.itextpdf.com/iText5/java= /5.5.11/index.html?com/itextpdf/text/pdf/PdfName.html#:~:text=3DClass%20Pdf= Name&text=3DPdfName%20is%20an%20object%20that,(page%2056-58)</a><br> <br> When I went into the Manual mentioned I did not manage to find a reason for= the restriction. I also tried to create a font with the same font name as = the one in your PDF but FontForge had a similar restriction to FOP (ASCII c= haracters only and not the escaped characters).<br> <br> I'm not sure if we should be changing FOP until we determine how the or= iginal font was created. If we do change FOP, we could change the exception= to a warning but I'm not sure what else could be impacted by this chan= ge.<br> <br> <br> Thanks<br> <br> -----Original Message-----<br> From: Mark Gibson <<a href=3D"mailto:[email protected]" t= arget=3D"_blank" rel=3D"noreferrer">[email protected]</a>>= ;<br> Sent: 23 January 2026 09:03<br> To: <a href=3D"mailto:[email protected]" target=3D"_blank" r= el=3D"noreferrer">[email protected]</a><br> Subject: RE: Font names using multi-byte strings<br> <br> Thanks Chris.<br> <br> Attached is the only example we have, and have knowingly seen.=C2=A0 And we= 've been working with Japanese clients for years now.<br> <br> <br> Mark<br> <br> -----Original Message-----<br> From: Chris Bowditch <<a href=3D"mailto:[email protected]" targ= et=3D"_blank" rel=3D"noreferrer">[email protected]</a>><br> Sent: 23 January 2026 14:44<br> To: <a href=3D"mailto:[email protected]" target=3D"_blank" r= el=3D"noreferrer">[email protected]</a><br> Subject: Re: Font names using multi-byte strings<br> <br> [EXTERNAL]<br> <br> Hi Mark,<br> <br> Are you able to attach your PDF so we can replicate this?<br> <br> Thanks,<br> <br> Chris<br> <br> On 15/01/2026 17:09, Mark Gibson wrote:<br> ><br> > Hi,<br> ><br> > I thought I=E2=80=99d just poll the community on this one, as I can=E2= =80=99t see it<br> > reported anywhere.<br> ><br> > We have a PDF that lists its fonts using Japanese characters (in this<= br> > case, it=E2=80=99s MS Gothic and MS PGothic, where =E2=80=9CGothic=E2= =80=9D actually is in<br> > Japanese characters).<br> ><br> > When trying to import that image using fo:external-graphic<br> > (fop-pdf-images.jar), we get an exception with the message =E2=80=9COn= ly 8-bit<br> > characters allowed by this implementation=E2=80=9D.<br> ><br> > In reviewing FOP code, org.apache.fop.pdf.PDFName.toHex() throws this<= br> > exception if the character id is > 256.<br> ><br> > Does this mean FOP cannot handle cases where the names of PDF records<= br> > are not in simple ascii range?<br> ><br> > Caused by: java.lang.IllegalArgumentException: Only 8-bit characters<b= r> > allowed by this implementation<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.fop.pdf.PDFName.toHex(P= DFName.java:78)<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.fop.pdf.PDFName.escapeN= ame(PDFName.java:64)<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.fop.pdf.PDFName.<ini= t>(PDFName.java:42)<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br> > org.apache.fop.render.pdf.pdfbox.PDFCloner.cloneForNewDocument(PDFClon= <br> > er.java:106)<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br> > org.apache.fop.render.pdf.pdfbox.PDFCloner.readCOSDictionary(PDFCloner= <br> > .java:154)<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br> > org.apache.fop.render.pdf.pdfbox.PDFCloner.cloneForNewDocument(PDFClon= <br> > er.java:104)<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br> > org.apache.fop.render.pdf.pdfbox.PDFCloner.readCOSObject(PDFCloner.jav= <br> > a:134)<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br> > org.apache.fop.render.pdf.pdfbox.PDFCloner.cloneForNewDocument(PDFClon= <br> > er.java:84)<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br> > org.apache.fop.render.pdf.pdfbox.PDFCloner.readCOSDictionary(PDFCloner= <br> > .java:154)<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br> > org.apache.fop.render.pdf.pdfbox.PDFCloner.cloneForNewDocument(PDFClon= <br> > er.java:104)<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br> > org.apache.fop.render.pdf.pdfbox.PDFCloner.readCOSDictionary(PDFCloner= <br> > .java:154)<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br> > org.apache.fop.render.pdf.pdfbox.PDFCloner.cloneForNewDocument(PDFClon= <br> > er.java:104)<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br> > org.apache.fop.render.pdf.pdfbox.PDFBoxAdapter.cloneForNewDocument(PDF= <br> > BoxAdapter.java:141)<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br> > org.apache.fop.render.pdf.pdfbox.PDFBoxAdapter.createStreamFromPDFBoxP= <br> > age(PDFBoxAdapter.java:212)<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br> > org.apache.fop.render.pdf.pdfbox.AbstractPDFBoxHandler.createStreamFor= <br> > PDF(AbstractPDFBoxHandler.java:111)<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br> > org.apache.fop.render.pdf.pdfbox.PDFBoxImageHandler.handleImage(PDFBox= <br> > ImageHandler.java:77)<br> ><br> <br> <br> ---------------------------------------------------------------------<br> To unsubscribe, e-mail: <a href=3D"mailto:fop-users-unsubscribe@xmlgraphics= .apache.org" target=3D"_blank" rel=3D"noreferrer">fop-users-unsubscribe@xml= graphics.apache.org</a><br> For additional commands, e-mail: <a href=3D"mailto:fop-users-help@xmlgraphi= cs.apache.org" target=3D"_blank" rel=3D"noreferrer">fop-users-help@xmlgraph= ics.apache.org</a><br> <br> ________________________________<br> Joao Andre Goncalves<br> Customer Developer<br> <br> t=C2=A0 | m 07733161880<br> [email protected]<br> <a href=3D"http://smartcommunications.com" rel=3D"noreferrer noreferrer" ta= rget=3D"_blank">smartcommunications.com</a><<a href=3D"https://www.smart= communications.com/" rel=3D"noreferrer noreferrer" target=3D"_blank">https:= //www.smartcommunications.com/</a>><br> <br> [<a href=3D"https://www.smartcommunications.com/wp-content/uploads/025_Tren= ds2026-450x160_v1.jpg" rel=3D"noreferrer noreferrer" target=3D"_blank">http= s://www.smartcommunications.com/wp-content/uploads/025_Trends2026-450x160_v= 1.jpg</a>]<<a href=3D"https://scale.smartcommunications.com/2026-Trends-= White-Paper.html?utm_source=3Doutlook&utm_medium=3Demail&utm_campai= gn=3Dwc-global-2026-white-paper-2026-trends" rel=3D"noreferrer noreferrer" = target=3D"_blank">https://scale.smartcommunications.com/2026-Trends-White-P= aper.html?utm_source=3Doutlook&utm_medium=3Demail&utm_campaign=3Dwc= -global-2026-white-paper-2026-trends</a>><br> <br> Explore the new era of AI-powered customer engagement. Get your copy of the= 2026 Trends Report now.<<a href=3D"https://scale.smartcommunications.co= m/2026-Trends-White-Paper.html?utm_source=3Doutlook&utm_medium=3Demail&= amp;utm_campaign=3Dwc-global-2026-white-paper-2026-trends" rel=3D"noreferre= r noreferrer" target=3D"_blank">https://scale.smartcommunications.com/2026-= Trends-White-Paper.html?utm_source=3Doutlook&utm_medium=3Demail&utm= _campaign=3Dwc-global-2026-white-paper-2026-trends</a>> Smart Communicat= ions is a trading name of SmartComms SC Limited which is registered in Engl= and under No. 4303041 whose registered office is at Suite 23, LCLB, 95 Mort= imer Street, London, W1W 7GB. Please consider the environment before printi= ng. The contents of this e-mail are intended for the named addressee only. = It contains confidential information. Unless you are the named addressee or= an authorized designee, you may not copy or use it, or disclose it to anyo= ne else. If you received it in error please notify us immediately and then = destroy it. Smart Communications will process your data as described in the= Smart Communications' External Privacy Policy.<<a href=3D"https://w= ww.smartcommunications.com/external-privacy-policy/" rel=3D"noreferrer nore= ferrer" target=3D"_blank">https://www.smartcommunications.com/external-priv= acy-policy/</a>><br> <br> Follow us on LinkedIn,<<a href=3D"https://www.linkedin.com/company/15166= 060/admin/" rel=3D"noreferrer noreferrer" target=3D"_blank">https://www.lin= kedin.com/company/15166060/admin/</a>> YouTube,<<a href=3D"https://ww= w.youtube.com/@Smart_Communications/" rel=3D"noreferrer noreferrer" target= =3D"_blank">https://www.youtube.com/@Smart_Communications/</a>> and X.&l= t;<a href=3D"https://x.com/ccminnovators?lang=3Den" rel=3D"noreferrer noref= errer" target=3D"_blank">https://x.com/ccminnovators?lang=3Den</a>><br> <br> ---------------------------------------------------------------------<br> To unsubscribe, e-mail: <a href=3D"mailto:fop-users-unsubscribe@xmlgraphics= .apache.org" target=3D"_blank" rel=3D"noreferrer">fop-users-unsubscribe@xml= graphics.apache.org</a><br> For additional commands, e-mail: <a href=3D"mailto:fop-users-help@xmlgraphi= cs.apache.org" target=3D"_blank" rel=3D"noreferrer">fop-users-help@xmlgraph= ics.apache.org</a><br> </blockquote></div> --0000000000008e4efa064972993e--