pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roberto Nibali <rnib...@gmail.com>
Subject This font type only supports 8-bit code points
Date Wed, 29 Jul 2015 14:06:25 GMT
Hi

After quite an odyssey, I have managed to properly set all appearances and
mimic the pesky Javascript functionality in my template PDFs, mostly thanks
to Maruan and Tilman.

Going into extended testing, I have started to embed some Chinese and
Japanese PDTextField entries using Adobe Acrobat. Adobe Acrobat Reader then
subsequently asked me to install the Asian Font pack extension; which I did.

Now, running my forms migration tool, I get stuck with the following error
message:

java.lang.IllegalArgumentException: This font type only supports 8-bit code
points
    at
org.apache.pdfbox.pdmodel.font.PDType1Font.encode(PDType1Font.java:327)
    at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:282)
    at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:311)
    at
org.apache.pdfbox.pdmodel.interactive.form.PlainTextFormatter.format(PlainTextFormatter.java:188)
    at
org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.insertGeneratedAppearance(AppearanceGeneratorHelper.java:307)
    at
org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceContent(AppearanceGeneratorHelper.java:171)
    at
org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceValue(AppearanceGeneratorHelper.java:126)
    at
org.apache.pdfbox.pdmodel.interactive.form.PDTextField.constructAppearances(PDTextField.java:262)
    at
org.apache.pdfbox.pdmodel.interactive.form.PDTerminalField.applyChange(PDTerminalField.java:220)
    at
org.apache.pdfbox.pdmodel.interactive.form.PDTextField.setValue(PDTextField.java:217)
    at pdftools.PDFMigrationTest.processField(PDFMigrationTest.java:124)
    at pdftools.PDFMigrationTest.processField(PDFMigrationTest.java:81)
    at pdftools.PDFMigrationTest.processField(PDFMigrationTest.java:81)
    at pdftools.PDFMigrationTest.doFields(PDFMigrationTest.java:70)
    at pdftools.PDFMigrationTest.SimpleTest(PDFMigrationTest.java:40)

Now, I understand that by enforcing /Cour 8pt in my code, there is a very
high chance that this might happen, however wouldn't it be nice to be able
to submit a fallback font supporting 16bit code points instead of crashing?

At the moment, this is more a cosmetic issue with some extensive testing I
did, as the client most likely will not be using Asian languages with 16bit
code points. However, better be safe than sorry, right?

Take care
Roberto

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message