pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1798245 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java
Date Fri, 09 Jun 2017 16:40:30 GMT
Author: tilman
Date: Fri Jun  9 16:40:30 2017
New Revision: 1798245

URL: http://svn.apache.org/viewvc?rev=1798245&view=rev
Log:
PDFBOX-3824: don't decode the stream to get the length

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java?rev=1798245&r1=1798244&r2=1798245&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java
Fri Jun  9 16:40:30 2017
@@ -231,9 +231,10 @@ final class PDCIDFontType2Embedder exten
             out.write(new byte[] { (byte)(gid >> 8 & 0xff), (byte)(gid & 0xff)
});
         }
 
-        InputStream input = new ByteArrayInputStream(out.toByteArray());
+        byte[] byteArray = out.toByteArray();
+        InputStream input = new ByteArrayInputStream(byteArray);
         PDStream stream = new PDStream(document, input, COSName.FLATE_DECODE);
-        stream.getCOSObject().setInt(COSName.LENGTH1, stream.toByteArray().length);
+        stream.getCOSObject().setInt(COSName.LENGTH1, byteArray.length);
 
         cidFont.setItem(COSName.CID_TO_GID_MAP, stream);
     }



Mime
View raw message