Package org.apache.pdfbox
Class Overlay
- java.lang.Object
-
- org.apache.pdfbox.Overlay
-
public class Overlay extends java.lang.ObjectOverlay on document with another one.
e.g. Overlay an invoice with your company layout
How it (should) work:
If the document has 10 pages, and the layout 2 the following is the result:
Document: 1234567890 Layout : 1212121212
- Version:
- $Revision: 1.7 $
- Author:
- Mario Ivankovits (mario@ops.co.at), Ben Litchfield
-
-
Field Summary
Fields Modifier and Type Field Description static COSNameEXT_G_STATEDeprecated.use theCOSName.EXT_G_STATEconstant insteadstatic COSNamePROC_SETDeprecated.use theCOSName.PROC_SETconstant insteadstatic COSNameXOBJECTDeprecated.use theCOSName.XOBJECTconstant instead
-
Constructor Summary
Constructors Constructor Description Overlay()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)This will overlay a document and write out the results.
usage: java org.apache.pdfbox.Overlay <overlay.pdf> <document.pdf> <result.pdf>PDDocumentoverlay(PDDocument overlay, PDDocument destination)This will overlay two documents onto each other.
-
-
-
Field Detail
-
XOBJECT
public static final COSName XOBJECT
Deprecated.use theCOSName.XOBJECTconstant instead
-
PROC_SET
public static final COSName PROC_SET
Deprecated.use theCOSName.PROC_SETconstant instead
-
EXT_G_STATE
public static final COSName EXT_G_STATE
Deprecated.use theCOSName.EXT_G_STATEconstant instead
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.io.IOException, COSVisitorExceptionThis will overlay a document and write out the results.
usage: java org.apache.pdfbox.Overlay <overlay.pdf> <document.pdf> <result.pdf>- Parameters:
args- The command line arguments.- Throws:
java.io.IOException- If there is an error reading/writing the document.COSVisitorException- If there is an error writing the document.
-
overlay
public PDDocument overlay(PDDocument overlay, PDDocument destination) throws java.io.IOException
This will overlay two documents onto each other. The overlay document is repeatedly overlayed onto the destination document for every page in the destination.- Parameters:
overlay- The document to copy onto the destinationdestination- The file that the overlay should be placed on.- Returns:
- The destination pdf, same as argument passed in.
- Throws:
java.io.IOException- If there is an error accessing data.
-
-