Package com.tom_roush.pdfbox.multipdf
Class Overlay
- java.lang.Object
-
- com.tom_roush.pdfbox.multipdf.Overlay
-
public class Overlay extends Object
Adds an overlay to an existing PDF document. Based on code contributed by Balazs Jerk.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOverlay.PositionPossible location of the overlayed pages: foreground or background.
-
Constructor Summary
Constructors Constructor Description Overlay()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDefaultOverlayFile()Returns the default overlay file.StringgetInputFile()Returns the input file.StringgetOutputFile()Returns the output file.voidoverlay(Map<Integer,String> specificPageOverlayFile)This will add overlays to a documents.voidsetAllPagesOverlayFile(String allPagesOverlayFile)Sets the all pages overlay file.voidsetAllPagesOverlayPDF(PDDocument allPagesOverlayPDF)Sets the all pages overlay PDF.voidsetDefaultOverlayFile(String defaultOverlayFile)Sets the default overlay file.voidsetDefaultOverlayPDF(PDDocument defaultOverlayPDF)Sets the default overlay PDF.voidsetEvenPageOverlayFile(String evenPageOverlayFile)Sets the even page overlay file.voidsetEvenPageOverlayPDF(PDDocument evenPageOverlayPDF)Sets the even page overlay PDF.voidsetFirstPageOverlayFile(String firstPageOverlayFile)Sets the first page overlay file.voidsetFirstPageOverlayPDF(PDDocument firstPageOverlayPDF)Sets the first page overlay PDF.voidsetInputFile(String inputFile)Sets the file to be overlayed.voidsetInputPDF(PDDocument inputPDF)Sets the PDF to be overlayed.voidsetLastPageOverlayFile(String lastPageOverlayFile)Sets the last page overlay file.voidsetLastPageOverlayPDF(PDDocument lastPageOverlayPDF)Sets the last page overlay PDF.voidsetOddPageOverlayFile(String oddPageOverlayFile)Sets the odd page overlay file.voidsetOddPageOverlayPDF(PDDocument oddPageOverlayPDF)Sets the odd page overlay PDF.voidsetOutputFile(String outputFile)Sets the output file.voidsetOverlayPosition(Overlay.Position overlayPosition)Sets the overlay position.
-
-
-
Method Detail
-
overlay
public void overlay(Map<Integer,String> specificPageOverlayFile) throws IOException
This will add overlays to a documents.- Parameters:
specificPageOverlayFile- map of overlay files for specific pages- Throws:
IOException- if something went wrong
-
setOverlayPosition
public void setOverlayPosition(Overlay.Position overlayPosition)
Sets the overlay position.- Parameters:
overlayPosition- the overlay position
-
setInputFile
public void setInputFile(String inputFile)
Sets the file to be overlayed.- Parameters:
inputFile- the file to be overlayed
-
setInputPDF
public void setInputPDF(PDDocument inputPDF)
Sets the PDF to be overlayed.- Parameters:
inputPDF- the PDF to be overlayed
-
getInputFile
public String getInputFile()
Returns the input file.- Returns:
- the input file
-
setOutputFile
public void setOutputFile(String outputFile)
Sets the output file.- Parameters:
outputFile- the output file
-
getOutputFile
public String getOutputFile()
Returns the output file.- Returns:
- the output file
-
setDefaultOverlayFile
public void setDefaultOverlayFile(String defaultOverlayFile)
Sets the default overlay file.- Parameters:
defaultOverlayFile- the default overlay file
-
setDefaultOverlayPDF
public void setDefaultOverlayPDF(PDDocument defaultOverlayPDF)
Sets the default overlay PDF.- Parameters:
defaultOverlayPDF- the default overlay PDF
-
getDefaultOverlayFile
public String getDefaultOverlayFile()
Returns the default overlay file.- Returns:
- the default overlay file
-
setFirstPageOverlayFile
public void setFirstPageOverlayFile(String firstPageOverlayFile)
Sets the first page overlay file.- Parameters:
firstPageOverlayFile- the first page overlay file
-
setFirstPageOverlayPDF
public void setFirstPageOverlayPDF(PDDocument firstPageOverlayPDF)
Sets the first page overlay PDF.- Parameters:
firstPageOverlayPDF- the first page overlay PDF
-
setLastPageOverlayFile
public void setLastPageOverlayFile(String lastPageOverlayFile)
Sets the last page overlay file.- Parameters:
lastPageOverlayFile- the last page overlay file
-
setLastPageOverlayPDF
public void setLastPageOverlayPDF(PDDocument lastPageOverlayPDF)
Sets the last page overlay PDF.- Parameters:
lastPageOverlayPDF- the last page overlay PDF
-
setAllPagesOverlayFile
public void setAllPagesOverlayFile(String allPagesOverlayFile)
Sets the all pages overlay file.- Parameters:
allPagesOverlayFile- the all pages overlay file
-
setAllPagesOverlayPDF
public void setAllPagesOverlayPDF(PDDocument allPagesOverlayPDF)
Sets the all pages overlay PDF.- Parameters:
allPagesOverlayPDF- the all pages overlay PDF
-
setOddPageOverlayFile
public void setOddPageOverlayFile(String oddPageOverlayFile)
Sets the odd page overlay file.- Parameters:
oddPageOverlayFile- the odd page overlay file
-
setOddPageOverlayPDF
public void setOddPageOverlayPDF(PDDocument oddPageOverlayPDF)
Sets the odd page overlay PDF.- Parameters:
oddPageOverlayPDF- the odd page overlay PDF
-
setEvenPageOverlayFile
public void setEvenPageOverlayFile(String evenPageOverlayFile)
Sets the even page overlay file.- Parameters:
evenPageOverlayFile- the even page overlay file
-
setEvenPageOverlayPDF
public void setEvenPageOverlayPDF(PDDocument evenPageOverlayPDF)
Sets the even page overlay PDF.- Parameters:
evenPageOverlayPDF- the even page overlay PDF
-
-