Package org.apache.pdfbox.tools
Class ImageToPDF
java.lang.Object
org.apache.pdfbox.tools.ImageToPDF
Create a PDF document from images.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate File[]private booleanprivate PDRectangleprivate Fileprivate Stringprivate booleanprivate final PrintStream -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall()private static PDRectanglecreateRectangle(String paperSize) Sets page size of produced PDF.booleanGets whether page orientation (portrait / landscape) should be decided automatically for each page depending on image proportion.booleanTells the paper orientation.static voidvoidsetAutoOrientation(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 Details
-
mediaBox
-
SYSERR
-
autoOrientation
private boolean autoOrientation -
landscape
private boolean landscape -
pageSize
-
resize
private boolean resize -
infiles
-
outfile
-
-
Constructor Details
-
ImageToPDF
public ImageToPDF()Constructor.
-
-
Method Details
-
main
-
call
-
createRectangle
-
getMediaBox
Sets page size of produced PDF.- Returns:
- returns the page size (media box)
-
setMediaBox
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.
-