pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1798252 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java
Date Fri, 09 Jun 2017 17:25:57 GMT
Author: tilman
Date: Fri Jun  9 17:25:57 2017
New Revision: 1798252

URL: http://svn.apache.org/viewvc?rev=1798252&view=rev
Log:
PDFBOX-3824: get the length of a ttf datastream without decoding it

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

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java?rev=1798252&r1=1798251&r2=1798252&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java
Fri Jun  9 17:25:57 2017
@@ -92,7 +92,7 @@ abstract class TrueTypeEmbedder implemen
         {
             // full embedding
             PDStream stream = new PDStream(document, ttf.getOriginalData(), COSName.FLATE_DECODE);
-            stream.getCOSObject().setInt(COSName.LENGTH1, stream.toByteArray().length);
+            stream.getCOSObject().setLong(COSName.LENGTH1, ttf.getOriginalDataSize());
             fontDescriptor.setFontFile2(stream);
         }
 



Mime
View raw message