> On 25 May 2016, at 01:14, Croe.David <[email protected]> wrote: > > Dear all, > > i'm trying to replace and center a text in a pdf which has been created by > phantomjs. > > I'm not sure if it's a problem within phantomjs or pdfbox, but I get > following exception while calculating the text width of a string starting > with Symbol %: > > Exception in thread "main" java.lang.IllegalArgumentException: No glyph for > U+0025 in font TimesNewRomanStandard > at > org.apache.pdfbox.pdmodel.font.PDCIDFontType2.encode(PDCIDFontType2.java:411) > at > org.apache.pdfbox.pdmodel.font.PDType0Font.encode(PDType0Font.java:351) > at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:286) > at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:315) > > > in PDCIDFontType2: > isEmbedded is true > parent.getCMap().getName() is Identity-H > cmap is null > cid is -1 > > > > a closer look with pdfdebugger , this is the toUnicode: > > /CIDInit /ProcSet findresource begin > 12 dict begin > begincmap > /CIDSystemInfo << /Registry (Adobe) /Ordering (UCS) /Supplement 0 >> def > /CMapName /Adobe-Identity-UCS def > /CMapType 2 def > 1 begincodespacerange > <0000> <FFFF> > endcodespacerange > 2 beginbfrange > <0000> <0000> <0000> > <0001> <0024> [<0025> <004E> <0041> <004D> <0045> <003A> <0043> <0054> <0052> > <0062> <0065> <0073> <0074> <0061> <006E> <0064> <0020> <006D> <0069> <0066> > <006F> <006C> <0067> <0072> <0050> <0075> <006B> <007A> <0068> <0055> <004B> > <0044> <00FC> <0042> <0079> <0070> ] > endbfrange > endcmap > CMapName currentdict /CMap defineresource pop > end > end > > how to calculate the width or fix the problem ?
As Tilman has suggested, this font is likely a subset and does not contain that symbol. You may be able to configure phantoms to not subset fonts, I believe that it uses CUPS-PDF for this. — John > best regards, > David Croé > ____________________________________________________________ > > [https://www.inside-online.de/mail/footer/anbieter_des_jahres.jpg]<http://www.inside-online.de/de/pressemeldungen-news/anbieter-des-jahres-2016.html?utm_source=Signatur&utm_medium=E-Mail&utm_campaign=Signatur-Anbieter-des-Jahres> > Danke an unsere Kunden für die Wahl zum Anbieter des Jahres 2016! > Kontaktieren Sie uns > hier<http://www.inside-online.de/de/kontaktieren.html?utm_source=Signatur&utm_medium=E-Mail&utm_campaign=Signatur-Anbieter-des-Jahres> > und erfahren Sie, warum uns unsere Kunden > zum Anbieter des Jahres gewählt haben. > Gerne sprechen wir auch über Ihr E-Learning-Projekt! > ____________________________________________________________ --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

