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 2020/10/19 09:35:00 UTC

[jira] [Updated] (PDFBOX-4990) say which resource not found when a font is missing

     [ https://issues.apache.org/jira/browse/PDFBOX-4990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tilman Hausherr updated PDFBOX-4990:
------------------------------------
    Fix Version/s: 3.0.0 PDFBox
                   2.0.22

> say which resource not found when a font is missing
> ---------------------------------------------------
>
>                 Key: PDFBOX-4990
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4990
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 2.0.21, 3.0.0 PDFBox
>            Reporter: Ralf Hauser
>            Priority: Minor
>             Fix For: 2.0.22, 3.0.0 PDFBox
>
>
> ### Eclipse Workspace Patch 1.0
> #P pdfbox
> Index: pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/Standard14Fonts.java
> ===================================================================
> --- pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/Standard14Fonts.java (revision 1882597)
> +++ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/Standard14Fonts.java (working copy)
> @@ -117,10 +117,13 @@
>  try (InputStream resourceAsStream = PDType1Font.class.getResourceAsStream(resourceName);
> InputStream afmStream = new BufferedInputStream(resourceAsStream))
> {
> + if (null == resourceAsStream) {
> + throw new IOException("resource '"+resourceName+"' not found");
> + }
> AFMParser parser = new AFMParser(afmStream);
> FontMetrics metric = parser.parse(true);
> FONTS.put(fontName, metric);
> - }
> + }
> }
>  
> /**
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org