You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (JIRA)" <ji...@apache.org> on 2013/04/17 20:45:16 UTC
[jira] [Closed] (PDFBOX-1567) Error Opening PDF in Adobe Reader -
The font 'HoneyScript-Light' contains bad /Widths.
[ https://issues.apache.org/jira/browse/PDFBOX-1567?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andreas Lehmkühler closed PDFBOX-1567.
--------------------------------------
Resolution: Duplicate
Assignee: Andreas Lehmkühler
Please update to the more recent version 1.8.1. This issue was fixed in 1.7.1
> Error Opening PDF in Adobe Reader - The font 'HoneyScript-Light' contains bad /Widths.
> ---------------------------------------------------------------------------------------
>
> Key: PDFBOX-1567
> URL: https://issues.apache.org/jira/browse/PDFBOX-1567
> Project: PDFBox
> Issue Type: Bug
> Components: FontBox, JempBox
> Affects Versions: 1.7.0
> Environment: Java, Linux , Mac OS
> Reporter: Harippriya Parameswaran
> Assignee: Andreas Lehmkühler
> Priority: Critical
>
> The pdf created using PDFBOX 1.7.0 file contains errors when opening in Adobe Reader with error msg: "The font 'HoneyScript-Light' contains bad /Widths."
> Created a new pdf file written with the below piece of code and tried to open it in Adobe Reader, while opening getting an error message- "The font 'HoneyScript-Light' contains bad /Widths." . This error is also occurring even while writing in existing pdf document.
> I am using Adobe Reader Version 11.0.1. , even tried in 10.1.6. the same issue persist
> PDDocument pdDocument = new PDDocument();
> pdDocument.addPage(new PDPage());
> BufferedImage bi = new BufferedImage(10, 10, 10);
> Points point = new Points(300, 500);
> @SuppressWarnings("unchecked")
> List<PDPage> list = pdDocument.getDocumentCatalog().getAllPages();
> PDPage pdPage = list.get(list.size() - 1);
> String fontPathName = "HoneyScript-Light.ttf";
> PDFont fonta = PDTrueTypeFont.loadTTF(pdDocument,
> Sample.class.getClassLoader()
> .getResource(fontPathName).openStream() );
> PDJpeg ximage = new PDJpeg(pdDocument, bi);
> PDPageContentStream contentStream = new PDPageContentStream(pdDocument,
> pdPage, true, true);
> contentStream.beginText();
> contentStream.setFont(fonta,18);
> contentStream.moveTextPositionByAmount(point.getX(), point.getY() - 10 );
> contentStream.setNonStrokingColor(Color.black);
> contentStream.drawString("Name: ");
> contentStream.endText();
> contentStream.close();
> pdDocument.save("test/Test.pdf");
> pdDocument.close();
> The same has been tried with fonts such as MyriadSetText.ttf, Miama.ttf, Myriad.ttf.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira