Package org.apache.pdfbox.tools
Class ImageToPDF
java.lang.Object
org.apache.pdfbox.tools.ImageToPDF
Creates a PDF document from images.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private boolean
private PDRectangle
private boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
createPDFFromImages
(PDDocument doc, List<String> imageFilenames) private static PDRectangle
createRectangle
(String paperSize) Sets page size of produced PDF.boolean
Gets whether page orientation (portrait / landscape) should be decided automatically for each page depending on image proportion.boolean
Tells the paper orientation.static void
void
setAutoOrientation
(boolean autoOrientation) Sets whether page orientation (portrait / landscape) should be decided automatically for each page depending on image proportion.void
setLandscape
(boolean landscape) Sets paper orientation.void
setMediaBox
(PDRectangle mediaBox) Sets page size of produced PDF.private void
usage()
This will print out a message telling how to use this example.
-
Field Details
-
mediaBox
-
landscape
private boolean landscape -
autoOrientation
private boolean autoOrientation -
resize
private boolean resize
-
-
Constructor Details
-
ImageToPDF
private ImageToPDF()
-
-
Method Details
-
main
- Throws:
IOException
-
createPDFFromImages
- Throws:
IOException
-
createRectangle
-
getMediaBox
Sets page size of produced PDF.- Returns:
- returns the page size (media box)
-
setMediaBox
Sets page size of produced PDF.- Parameters:
mediaBox
-
-
isLandscape
public boolean isLandscape()Tells the paper orientation.- Returns:
- true for landscape orientation
-
setLandscape
public void setLandscape(boolean landscape) Sets paper orientation.- Parameters:
landscape
-
-
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.
-
usage
private void usage()This will print out a message telling how to use this example.
-