You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2015/09/02 17:33:45 UTC
[jira] [Commented] (PDFBOX-2954) Error trying to show Spanish or
French characters with PDFBOX
[ https://issues.apache.org/jira/browse/PDFBOX-2954?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14727512#comment-14727512 ]
Tilman Hausherr commented on PDFBOX-2954:
-----------------------------------------
See also https://stackoverflow.com/questions/32351565/ , using
{code}
PDType0Font font = PDType0Font.load(document, new File("c:/windows/fonts/arialuni.ttf"));
{code}
didn't help either.
[~loonger] what encoding does your source code use? In what country did you buy or update the windows you're using now? Do you have access to a W7 system, and if yes, does the effect also happen there?
> Error trying to show Spanish or French characters with PDFBOX
> -------------------------------------------------------------
>
> Key: PDFBOX-2954
> URL: https://issues.apache.org/jira/browse/PDFBOX-2954
> Project: PDFBox
> Issue Type: Bug
> Components: FontBox, Writing
> Affects Versions: 2.0.0
> Environment: Windows 10, Java 8
> Reporter: Ivan de la Fuente
>
> When I create a PDF with PDFBOX 2.0.0 SNAPSHOT using the typical Hello World example with Spanish and French characters:
> {code}
> PDDocument document = new PDDocument();
> PDPage page = new PDPage(PDRectangle.A4);
> document.addPage(page);
> PDType1Font font = PDType1Font.HELVETICA;
> PDPageContentStream stream = new PDPageContentStream(document, page);
> String text = "áÁÀà";
> stream.beginText();
> stream.setFont(font, 12);
> stream.newLineAtOffset(100, 700);
> stream.showText(text);
> stream.endText();
> stream.close();
> document.save("sample.pdf");
> document.close();
> {code}
> I get this error:
> {code}
> sep 02, 2015 12:42:43 PM org.apache.pdfbox.pdmodel.font.PDType1Font <init>
> ADVERTENCIA: Using fallback font ArialMT for base font ZapfDingbats
> Exception in thread "main" java.lang.IllegalArgumentException: This font type only supports 8-bit code points
> {code}
> If I load {{arialuni.ttf}} font with Type0 it compiles but only get question marks instead of the correct characters in the PDF file.
> I have tried PDFBOX 1.8 and doesn´t work either.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org