Class ImageToPDF

java.lang.Object
org.apache.pdfbox.tools.ImageToPDF
All Implemented Interfaces:
Callable<Integer>

public final class ImageToPDF extends Object implements Callable<Integer>
Create a PDF document from images.
  • Field Details

    • mediaBox

      private PDRectangle mediaBox
    • SYSERR

      private final PrintStream SYSERR
    • autoOrientation

      private boolean autoOrientation
    • landscape

      private boolean landscape
    • pageSize

      private String pageSize
    • resize

      private boolean resize
    • infiles

      private File[] infiles
    • outfile

      private File outfile
  • Constructor Details

    • ImageToPDF

      public ImageToPDF()
      Constructor.
  • Method Details

    • main

      public static void main(String[] args)
    • call

      public Integer call()
      Specified by:
      call in interface Callable<Integer>
    • createRectangle

      private static PDRectangle createRectangle(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.