pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1845721 - in /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox: multipdf/LayerUtility.java pdmodel/PDDocument.java
Date Sun, 04 Nov 2018 10:10:47 GMT
Author: tilman
Date: Sun Nov  4 10:10:47 2018
New Revision: 1845721

URL: http://svn.apache.org/viewvc?rev=1845721&view=rev
Log:
PDFBOX-3428, PDFBOX-3280: format + improve + correct javadoc

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/LayerUtility.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/LayerUtility.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/LayerUtility.java?rev=1845721&r1=1845720&r2=1845721&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/LayerUtility.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/LayerUtility.java
Sun Nov  4 10:10:47 2018
@@ -45,9 +45,9 @@ import org.apache.pdfbox.pdmodel.graphic
 import org.apache.pdfbox.util.Matrix;
 
 /**
- * This class allows to import pages as Form XObjects into a PDF file and use them to create
- * layers (optional content groups).
- *
+ * This class allows to import pages as Form XObjects into a document and use them to create
layers
+ * (optional content groups). It should used only on loaded documents, not on generated documents
+ * because these can contain unfinished parts, e.g. font subsetting information.
  */
 public class LayerUtility
 {

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java?rev=1845721&r1=1845720&r2=1845721&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java Sun
Nov  4 10:10:47 2018
@@ -695,23 +695,28 @@ public class PDDocument implements Close
     }
 
     /**
-     * This will import and copy the contents from another location. Currently the content
stream is stored in a scratch
-     * file. The scratch file is associated with the document. If you are adding a page to
this document from another
-     * document and want to copy the contents to this
-     * document's scratch file then use this method otherwise just use the {@link #addPage
addPage}
+     * This will import and copy the contents from another location. Currently the content
stream is
+     * stored in a scratch file. The scratch file is associated with the document. If you
are adding
+     * a page to this document from another document and want to copy the contents to this
+     * document's scratch file then use this method otherwise just use the {@link #addPage
addPage()}
      * method.
      * <p>
-     * Unlike {@link #addPage addPage}, this method creates a new PDPage object. If your
page has
+     * Unlike {@link #addPage addPage()}, this method creates a new PDPage object. If your
page has
      * annotations, and if these link to pages not in the target document, then the target
document
      * might become huge. What you need to do is to delete page references of such annotations.
See
      * <a href="http://stackoverflow.com/a/35477351/535646">here</a> for how
to do this.
      * <p>
-     * Inherited (global) resources are ignored. If you need them, call
-     * <code>importedPage.setRotation(page.getRotation());</code>
+     * Inherited (global) resources are ignored because these can contain resources not needed
for
+     * this page which could bloat your document, see
+     * <a href="https://issues.apache.org/jira/browse/PDFBOX-28">PDFBOX-28</a>
and related issues.
+     * If you need them, call <code>importedPage.setResources(page.getResources());</code>
+     * <p>
+     * This method should only be used to import a page from a loaded document, not from
a generated
+     * document because these can contain unfinished parts, e.g. font subsetting information.
      *
      * @param page The page to import.
      * @return The page that was imported.
-     * 
+     *
      * @throws IOException If there is an error copying the page.
      */
     public PDPage importPage(PDPage page) throws IOException



Mime
View raw message