Class PDFPrintSupport.Configuration

  • Enclosing class:
    PDFPrintSupport

    public static final class PDFPrintSupport.Configuration
    extends java.lang.Object
    This class is a simple container for the configuration information that is passed to a PDFPrintSupport.PDFWriter.

    This class may change incompatibly in future versions.

    • Constructor Summary

      Constructors 
      Constructor Description
      Configuration​(PDFPrintSupport.Configuration toCopy)
      Creates a new configuration that copies its state from a template.
      Configuration​(java.io.File destination)
      Creates a new configuration instance for writing a PDF file to the specified destination.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAuthor()
      Returns the value to use as the document author's name in the PDF metadata; if null a default, empty value is used.
      java.io.File getOutputFile()
      Returns the file that the destination will be written to; may not be null.
      double getPageHeight()
      Returns the height of document pages, measured in points.
      double getPageWidth()
      Returns the width of document pages, measured in points.
      float getQuality()
      Returns the output quality level.
      java.lang.String getSubject()
      Returns the value to use as the subject of the document in the PDF metadata; if null a default, empty value is used.
      java.lang.String getTitle()
      Returns the value to use as the title of the document in the PDF metadata; if null a default, empty value is used.
      void setAuthor​(java.lang.String author)
      Sets the value to use as the document author's name in the PDF metadata; if null a default, empty value is used.
      void setOutputFile​(java.io.File destination)
      Sets the file that the destination will be written to; may not be null.
      void setPageDimensions​(PaperProperties pp)
      Sets the width and height of document pages from a PaperProperties object representing the target paper size.
      void setPageHeight​(double pageHeightInPoints)
      The height of document pages, measured in points; must be a positive value.
      void setPageWidth​(double pageWidthInPoints)
      Sets the width of document pages, measured in points; must be a positive value.
      void setQuality​(float quality)
      Sets the output quality level.
      void setSubject​(java.lang.String subject)
      Sets the value to use as the subject of the document in the PDF metadata; if null a default, empty value is used.
      void setTitle​(java.lang.String title)
      Sets the value to use as the title of the document in the PDF metadata; if null a default, empty value is used.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Configuration

        public Configuration​(java.io.File destination)
        Creates a new configuration instance for writing a PDF file to the specified destination.
        Parameters:
        destination - the PDF output file
        Throws:
        java.lang.NullPointerException - if the file is null
      • Configuration

        public Configuration​(PDFPrintSupport.Configuration toCopy)
        Creates a new configuration that copies its state from a template.
        Parameters:
        toCopy - the configuration to copy
    • Method Detail

      • getOutputFile

        public java.io.File getOutputFile()
        Returns the file that the destination will be written to; may not be null.
        Returns:
        the destination
      • setOutputFile

        public void setOutputFile​(java.io.File destination)
        Sets the file that the destination will be written to; may not be null.
        Parameters:
        destination - the PDF output file
        Throws:
        java.lang.NullPointerException - if the file is null
      • setPageDimensions

        public void setPageDimensions​(PaperProperties pp)
        Sets the width and height of document pages from a PaperProperties object representing the target paper size.
        Parameters:
        pp - the paper properties to copy the page width and height from
      • getPageWidth

        public double getPageWidth()
        Returns the width of document pages, measured in points.
        Returns:
        the page width in points
      • setPageWidth

        public void setPageWidth​(double pageWidthInPoints)
        Sets the width of document pages, measured in points; must be a positive value.
        Parameters:
        pageWidthInPoints - the page width
      • getPageHeight

        public double getPageHeight()
        Returns the height of document pages, measured in points.
        Returns:
        the page height in points
      • setPageHeight

        public void setPageHeight​(double pageHeightInPoints)
        The height of document pages, measured in points; must be a positive value.
        Parameters:
        pageHeightInPoints - the pageHeightInPoints to set
      • getTitle

        public java.lang.String getTitle()
        Returns the value to use as the title of the document in the PDF metadata; if null a default, empty value is used.
        Returns:
        the document title
      • setTitle

        public void setTitle​(java.lang.String title)
        Sets the value to use as the title of the document in the PDF metadata; if null a default, empty value is used.
        Parameters:
        title - the document title to set
      • getAuthor

        public java.lang.String getAuthor()
        Returns the value to use as the document author's name in the PDF metadata; if null a default, empty value is used.
        Returns:
        the document author
      • setAuthor

        public void setAuthor​(java.lang.String author)
        Sets the value to use as the document author's name in the PDF metadata; if null a default, empty value is used.
        Parameters:
        author - the document author to set
      • getSubject

        public java.lang.String getSubject()
        Returns the value to use as the subject of the document in the PDF metadata; if null a default, empty value is used.
        Returns:
        the document subject
      • setSubject

        public void setSubject​(java.lang.String subject)
        Sets the value to use as the subject of the document in the PDF metadata; if null a default, empty value is used.
        Parameters:
        subject - the document subject to set
      • getQuality

        public float getQuality()
        Returns the output quality level. This is a value between 0 and 1 inclusive, where 1 represents maximum quality and 0 represents minimum file size.
        Returns:
        the quality setting
      • setQuality

        public void setQuality​(float quality)
        Sets the output quality level. This is a value between 0 and 1 inclusive, where higher values suggest higher quality output, generally at the cost of larger file size. Note that PDF writers are not required to use this value.
        Parameters:
        quality - the new quality setting
        Throws:
        java.lang.IllegalArgumentException - if the quality is not in the range 0 to 1.