Package org.apache.pdfbox.tools
Class ImageToPDF
- java.lang.Object
-
- org.apache.pdfbox.tools.ImageToPDF
-
- All Implemented Interfaces:
java.util.concurrent.Callable<java.lang.Integer>
public final class ImageToPDF extends java.lang.Object implements java.util.concurrent.Callable<java.lang.Integer>Create a PDF document from images.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanautoOrientationprivate java.io.File[]infilesprivate booleanlandscapeprivate PDRectanglemediaBoxprivate java.io.Fileoutfileprivate java.lang.StringpageSizeprivate booleanresizeprivate java.io.PrintStreamSYSERR
-
Constructor Summary
Constructors Constructor Description ImageToPDF()Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Integercall()private static PDRectanglecreateRectangle(java.lang.String paperSize)PDRectanglegetMediaBox()Sets page size of produced PDF.booleanisAutoOrientation()Gets whether page orientation (portrait / landscape) should be decided automatically for each page depending on image proportion.booleanisLandscape()Tells the paper orientation.static voidmain(java.lang.String[] args)voidsetAutoOrientation(boolean autoOrientation)Sets whether page orientation (portrait / landscape) should be decided automatically for each page depending on image proportion.voidsetLandscape(boolean landscape)Sets paper orientation.voidsetMediaBox(PDRectangle mediaBox)Sets page size of produced PDF.
-
-
-
Field Detail
-
mediaBox
private PDRectangle mediaBox
-
SYSERR
private final java.io.PrintStream SYSERR
-
autoOrientation
private boolean autoOrientation
-
landscape
private boolean landscape
-
pageSize
private java.lang.String pageSize
-
resize
private boolean resize
-
infiles
private java.io.File[] infiles
-
outfile
private java.io.File outfile
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
-
call
public java.lang.Integer call()
- Specified by:
callin interfacejava.util.concurrent.Callable<java.lang.Integer>
-
createRectangle
private static PDRectangle createRectangle(java.lang.String paperSize)
-
getMediaBox
public PDRectangle getMediaBox()
Sets page size of produced PDF.- Returns:
- returns the page size (media box)
-
setMediaBox
public void setMediaBox(PDRectangle mediaBox)
Sets page size of produced PDF.- Parameters:
mediaBox- the media box of the PDF document.
-
isLandscape
public boolean isLandscape()
Tells the paper orientation.- Returns:
- true for landscape orientation
-
setLandscape
public void setLandscape(boolean landscape)
Sets paper orientation.- Parameters:
landscape- use landscape orientation.
-
isAutoOrientation
public boolean isAutoOrientation()
Gets whether page orientation (portrait / landscape) should be decided automatically for each page depending on image proportion.- Returns:
- true if auto, false if not.
-
setAutoOrientation
public void setAutoOrientation(boolean autoOrientation)
Sets whether page orientation (portrait / landscape) should be decided automatically for each page depending on image proportion.- Parameters:
autoOrientation- true if auto, false if not.
-
-