Author: tilman
Date: Thu Aug 15 17:22:00 2019
New Revision: 1865245

URL: http://svn.apache.org/viewvc?rev=1865245&view=rev
Log:
PDFBOX-4080: use new method to lessen memory footprint, as suggested by 
Ghenadii Batalski

Modified:
    
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDHighlightAppearanceHandler.java
    
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDSquigglyAppearanceHandler.java

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDHighlightAppearanceHandler.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDHighlightAppearanceHandler.java?rev=1865245&r1=1865244&r2=1865245&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDHighlightAppearanceHandler.java
 (original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDHighlightAppearanceHandler.java
 Thu Aug 15 17:22:00 2019
@@ -126,8 +126,8 @@ public class PDHighlightAppearanceHandle
             cs.setGraphicsStateParameters(r1);
             //TODO replace with document.getDocument().createCOSStream()
             //     or call new PDFormXObject(document)
-            PDFormXObject frm1 = new PDFormXObject(new COSStream());
-            PDFormXObject frm2 = new PDFormXObject(new COSStream());
+            PDFormXObject frm1 = new PDFormXObject(createCOSStream());
+            PDFormXObject frm2 = new PDFormXObject(createCOSStream());
             frm1.setResources(new PDResources());
             try (PDFormContentStream mwfofrmCS = new PDFormContentStream(frm1))
             {

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDSquigglyAppearanceHandler.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDSquigglyAppearanceHandler.java?rev=1865245&r1=1865244&r2=1865245&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDSquigglyAppearanceHandler.java
 (original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDSquigglyAppearanceHandler.java
 Thu Aug 15 17:22:00 2019
@@ -131,7 +131,7 @@ public class PDSquigglyAppearanceHandler
                 // Create form, BBox is mostly fixed, except for the 
horizontal size which is
                 // horizontal size divided by the horizontal transform factor 
from above
                 // (almost)
-                PDFormXObject form = new PDFormXObject(new COSStream());
+                PDFormXObject form = new PDFormXObject(createCOSStream());
                 form.setBBox(new PDRectangle(-0.5f, -0.5f, (pathsArray[i * 8 + 
2] - pathsArray[i * 8]) / height * 40f + 0.5f, 13));
                 form.setResources(new PDResources());
                 form.setMatrix(AffineTransform.getTranslateInstance(0.5f, 
0.5f));


Reply via email to