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 &lt;<a href=3D"mailto:JGoncalves@smartcomm=
unications.com">[email protected]</a>&gt; 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&amp;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&amp;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&#39;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&#39;m not sure what else could be impacted by this chan=
ge.<br>
<br>
<br>
Thanks<br>
<br>
-----Original Message-----<br>
From: Mark Gibson &lt;<a href=3D"mailto:[email protected]" t=
arget=3D"_blank" rel=3D"noreferrer">[email protected]</a>&gt=
;<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=
&#39;ve been working with Japanese clients for years now.<br>
<br>
<br>
Mark<br>
<br>
-----Original Message-----<br>
From: Chris Bowditch &lt;<a href=3D"mailto:[email protected]" targ=
et=3D"_blank" rel=3D"noreferrer">[email protected]</a>&gt;<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>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; I thought I=E2=80=99d just poll the community on this one, as I can=E2=
=80=99t see it<br>
&gt; reported anywhere.<br>
&gt;<br>
&gt; We have a PDF that lists its fonts using Japanese characters (in this<=
br>
&gt; case, it=E2=80=99s MS Gothic and MS PGothic, where =E2=80=9CGothic=E2=
=80=9D actually is in<br>
&gt; Japanese characters).<br>
&gt;<br>
&gt; When trying to import that image using fo:external-graphic<br>
&gt; (fop-pdf-images.jar), we get an exception with the message =E2=80=9COn=
ly 8-bit<br>
&gt; characters allowed by this implementation=E2=80=9D.<br>
&gt;<br>
&gt; In reviewing FOP code, org.apache.fop.pdf.PDFName.toHex() throws this<=
br>
&gt; exception if the character id is &gt; 256.<br>
&gt;<br>
&gt; Does this mean FOP cannot handle cases where the names of PDF records<=
br>
&gt; are not in simple ascii range?<br>
&gt;<br>
&gt; Caused by: java.lang.IllegalArgumentException: Only 8-bit characters<b=
r>
&gt; allowed by this implementation<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.fop.pdf.PDFName.toHex(P=
DFName.java:78)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.fop.pdf.PDFName.escapeN=
ame(PDFName.java:64)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.fop.pdf.PDFName.&lt;ini=
t&gt;(PDFName.java:42)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br>
&gt; org.apache.fop.render.pdf.pdfbox.PDFCloner.cloneForNewDocument(PDFClon=
<br>
&gt; er.java:106)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br>
&gt; org.apache.fop.render.pdf.pdfbox.PDFCloner.readCOSDictionary(PDFCloner=
<br>
&gt; .java:154)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br>
&gt; org.apache.fop.render.pdf.pdfbox.PDFCloner.cloneForNewDocument(PDFClon=
<br>
&gt; er.java:104)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br>
&gt; org.apache.fop.render.pdf.pdfbox.PDFCloner.readCOSObject(PDFCloner.jav=
<br>
&gt; a:134)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br>
&gt; org.apache.fop.render.pdf.pdfbox.PDFCloner.cloneForNewDocument(PDFClon=
<br>
&gt; er.java:84)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br>
&gt; org.apache.fop.render.pdf.pdfbox.PDFCloner.readCOSDictionary(PDFCloner=
<br>
&gt; .java:154)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br>
&gt; org.apache.fop.render.pdf.pdfbox.PDFCloner.cloneForNewDocument(PDFClon=
<br>
&gt; er.java:104)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br>
&gt; org.apache.fop.render.pdf.pdfbox.PDFCloner.readCOSDictionary(PDFCloner=
<br>
&gt; .java:154)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br>
&gt; org.apache.fop.render.pdf.pdfbox.PDFCloner.cloneForNewDocument(PDFClon=
<br>
&gt; er.java:104)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br>
&gt; org.apache.fop.render.pdf.pdfbox.PDFBoxAdapter.cloneForNewDocument(PDF=
<br>
&gt; BoxAdapter.java:141)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br>
&gt; org.apache.fop.render.pdf.pdfbox.PDFBoxAdapter.createStreamFromPDFBoxP=
<br>
&gt; age(PDFBoxAdapter.java:212)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br>
&gt; org.apache.fop.render.pdf.pdfbox.AbstractPDFBoxHandler.createStreamFor=
<br>
&gt; PDF(AbstractPDFBoxHandler.java:111)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at<br>
&gt; org.apache.fop.render.pdf.pdfbox.PDFBoxImageHandler.handleImage(PDFBox=
<br>
&gt; ImageHandler.java:77)<br>
&gt;<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>&lt;<a href=3D"https://www.smart=
communications.com/" rel=3D"noreferrer noreferrer" target=3D"_blank">https:=
//www.smartcommunications.com/</a>&gt;<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>]&lt;<a href=3D"https://scale.smartcommunications.com/2026-Trends-=
White-Paper.html?utm_source=3Doutlook&amp;utm_medium=3Demail&amp;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&amp;utm_medium=3Demail&amp;utm_campaign=3Dwc=
-global-2026-white-paper-2026-trends</a>&gt;<br>
<br>
Explore the new era of AI-powered customer engagement. Get your copy of the=
 2026 Trends Report now.&lt;<a href=3D"https://scale.smartcommunications.co=
m/2026-Trends-White-Paper.html?utm_source=3Doutlook&amp;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&amp;utm_medium=3Demail&amp;utm=
_campaign=3Dwc-global-2026-white-paper-2026-trends</a>&gt; 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&#39; External Privacy Policy.&lt;<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>&gt;<br>
<br>
Follow us on LinkedIn,&lt;<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>&gt; YouTube,&lt;<a href=3D"https://ww=
w.youtube.com/@Smart_Communications/" rel=3D"noreferrer noreferrer" target=
=3D"_blank">https://www.youtube.com/@Smart_Communications/</a>&gt; 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>&gt;<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--