Package org.apache.pdfbox.util
Class Overlay
java.lang.Object
org.apache.pdfbox.util.Overlay
Adds an overlay to an existing PDF document.
Based on code contributed by Balazs Jerk.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Possible location of the overlayed pages: foreground or background. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the default overlay file.Returns the input file.Returns the output file.void
This will add overlays to a documents.void
setAllPagesOverlayFile
(String allPagesOverlayFile) Sets the all pages overlay file.void
setAllPagesOverlayPDF
(PDDocument allPagesOverlayPDF) Sets the all pages overlay PDF.void
setDefaultOverlayFile
(String defaultOverlayFile) Sets the default overlay file.void
setDefaultOverlayPDF
(PDDocument defaultOverlayPDF) Sets the default overlay PDF.void
setEvenPageOverlayFile
(String evenPageOverlayFile) Sets the even page overlay file.void
setEvenPageOverlayPDF
(PDDocument evenPageOverlayPDF) Sets the even page overlay PDF.void
setFirstPageOverlayFile
(String firstPageOverlayFile) Sets the first page overlay file.void
setFirstPageOverlayPDF
(PDDocument firstPageOverlayPDF) Sets the first page overlay PDF.void
setInputFile
(String inputFile) Sets the file to be overlayed.void
setInputPDF
(PDDocument inputPDF) Sets the PDF to be overlayed.void
setLastPageOverlayFile
(String lastPageOverlayFile) Sets the last page overlay file.void
setLastPageOverlayPDF
(PDDocument lastPageOverlayPDF) Sets the last page overlay PDF.void
setOddPageOverlayFile
(String oddPageOverlayFile) Sets the odd page overlay file.void
setOddPageOverlayPDF
(PDDocument oddPageOverlayPDF) Sets the odd page overlay PDF.void
setOutputFile
(String outputFile) Sets the output file.void
setOverlayPosition
(Overlay.Position overlayPosition) Sets the overlay position.
-
Constructor Details
-
Overlay
public Overlay()
-
-
Method Details
-
overlay
public void overlay(Map<Integer, String> specificPageOverlayFile, boolean useNonSeqParser) throws IOException, COSVisitorExceptionThis will add overlays to a documents.- Parameters:
specificPageOverlayFile
- map of overlay files for specific pagesuseNonSeqParser
- indicates whether the non-sequential parser is used- Throws:
IOException
- if something went wrongCOSVisitorException
- if something went wrong when savin the pdf
-
setOverlayPosition
Sets the overlay position.- Parameters:
overlayPosition
- the overlay position
-
setInputFile
Sets the file to be overlayed.- Parameters:
inputFile
- the file to be overlayed
-
setInputPDF
Sets the PDF to be overlayed.- Parameters:
inputPDF
- the PDF to be overlayed
-
getInputFile
Returns the input file.- Returns:
- the input file
-
setOutputFile
Sets the output file.- Parameters:
outputFile
- the output file
-
getOutputFile
Returns the output file.- Returns:
- the output file
-
setDefaultOverlayFile
Sets the default overlay file.- Parameters:
defaultOverlayFile
- the default overlay file
-
setDefaultOverlayPDF
Sets the default overlay PDF.- Parameters:
defaultOverlayPDF
- the default overlay PDF
-
getDefaultOverlayFile
Returns the default overlay file.- Returns:
- the default overlay file
-
setFirstPageOverlayFile
Sets the first page overlay file.- Parameters:
firstPageOverlayFile
- the first page overlay file
-
setFirstPageOverlayPDF
Sets the first page overlay PDF.- Parameters:
firstPageOverlayPDF
- the first page overlay PDF
-
setLastPageOverlayFile
Sets the last page overlay file.- Parameters:
lastPageOverlayFile
- the last page overlay file
-
setLastPageOverlayPDF
Sets the last page overlay PDF.- Parameters:
lastPageOverlayPDF
- the last page overlay PDF
-
setAllPagesOverlayFile
Sets the all pages overlay file.- Parameters:
allPagesOverlayFile
- the all pages overlay file
-
setAllPagesOverlayPDF
Sets the all pages overlay PDF.- Parameters:
allPagesOverlayPDF
- the all pages overlay PDF
-
setOddPageOverlayFile
Sets the odd page overlay file.- Parameters:
oddPageOverlayFile
- the odd page overlay file
-
setOddPageOverlayPDF
Sets the odd page overlay PDF.- Parameters:
oddPageOverlayPDF
- the odd page overlay PDF
-
setEvenPageOverlayFile
Sets the even page overlay file.- Parameters:
evenPageOverlayFile
- the even page overlay file
-
setEvenPageOverlayPDF
Sets the even page overlay PDF.- Parameters:
evenPageOverlayPDF
- the even page overlay PDF
-