Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-4990

say which resource not found when a font is missing

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.21, 3.0.0 PDFBox
    • Fix Version/s: 2.0.22, 3.0.0 PDFBox
    • Component/s: None
    • Labels:
      None
    • Flags:
      Patch

      Description

          1. 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);

      • }

      + }

      }

       

      /**

       

        Attachments

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              hauser@acm.org Ralf Hauser
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: