Class PDFRoot

  • All Implemented Interfaces:
    PDFWritable

    public class PDFRoot
    extends PDFDictionary
    Class representing a Root (/Catalog) object.
    • Field Detail

      • PAGEMODE_USENONE

        public static final int PAGEMODE_USENONE
        Use no page mode setting, default
        See Also:
        Constant Field Values
      • PAGEMODE_USEOUTLINES

        public static final int PAGEMODE_USEOUTLINES
        Use outlines page mode to show bookmarks
        See Also:
        Constant Field Values
      • PAGEMODE_USETHUMBS

        public static final int PAGEMODE_USETHUMBS
        Use thumbs page mode to show thumbnail images
        See Also:
        Constant Field Values
      • PAGEMODE_FULLSCREEN

        public static final int PAGEMODE_FULLSCREEN
        Full screen page mode
        See Also:
        Constant Field Values
    • Constructor Detail

      • PDFRoot

        public PDFRoot​(PDFDocument document,
                       PDFPages pages)
        create a Root (/Catalog) object. NOTE: The PDFRoot object must be created before the PDF document is generated, but it is not assigned an object ID until it is about to be written (immediately before the xref table as part of the trailer). (mark-fop@inomial.com)
        Parameters:
        document - TODO
        pages - the PDFPages object
    • Method Detail

      • output

        public int output​(java.io.OutputStream stream)
                   throws java.io.IOException
        Write the PDF represention of this object
        Overrides:
        output in class PDFDictionary
        Parameters:
        stream - the stream to write the PDF to
        Returns:
        the number of bytes written
        Throws:
        java.io.IOException - if there is an error writing to the stream
      • setPageMode

        public void setPageMode​(int mode)
        Set the page mode for the PDF document.
        Parameters:
        mode - the page mode (one of PAGEMODE_*)
      • getPageMode

        public int getPageMode()
        Returns the currently active /PageMode.
        Returns:
        the /PageMode (one of PAGEMODE_*)
      • addPage

        public void addPage​(PDFPage page)
        add a /Page object to the root /Pages object
        Parameters:
        page - the /Page object to add
      • setRootPages

        public void setRootPages​(PDFPages pages)
        set the root /Pages object
        Parameters:
        pages - the /Pages object to set as root
      • getRootPages

        public PDFPages getRootPages()
        Returns the /PageLabels object.
        Returns:
        the /PageLabels object if set, null otherwise.
        Since:
        PDF 1.3
      • setPageLabels

        public void setPageLabels​(PDFPageLabels pageLabels)
        Sets the /PageLabels object.
        Parameters:
        pageLabels - the /PageLabels object
      • getPageLabels

        public PDFPageLabels getPageLabels()
        Returns the /PageLabels object.
        Returns:
        the /PageLabels object if set, null otherwise.
        Since:
        PDF 1.3
      • setRootOutline

        public void setRootOutline​(PDFOutline out)
        Set the root outline for the PDF document.
        Parameters:
        out - the root PDF Outline
      • getRootOutline

        public PDFOutline getRootOutline()
        Get the root PDF outline for the document.
        Returns:
        the root PDF Outline
      • setNames

        public void setNames​(PDFNames names)
        Set the /Names object.
        Parameters:
        names - the Names object
        Since:
        PDF 1.2
      • getNames

        public PDFNames getNames()
        Returns the /Names object.
        Returns:
        the Names object if set, null otherwise.
        Since:
        PDF 1.2
      • setMetadata

        public void setMetadata​(PDFMetadata meta)
        Set the optional Metadata object.
        Parameters:
        meta - the Metadata object
        Since:
        PDF 1.4
      • getMetadata

        public PDFMetadata getMetadata()
        Returns the /Metadata object
        Returns:
        the /Metadata object if set, null otherwise.
        Since:
        PDF 1.4
      • getOutputIntents

        public PDFArray getOutputIntents()
        Returns the /OutputIntents array.
        Returns:
        the /OutputIntents array or null if it doesn't exist
        Since:
        PDF 1.4
      • addOutputIntent

        public void addOutputIntent​(PDFOutputIntent outputIntent)
        Adds an OutputIntent to the PDF
        Parameters:
        outputIntent - the OutputIntent dictionary
        Since:
        PDF 1.4
      • getLanguage

        public java.lang.String getLanguage()
        Returns the language identifier of the document.
        Returns:
        the language identifier of the document (or null if not set or undefined)
        Since:
        PDF 1.4
      • setLanguage

        public void setLanguage​(java.util.Locale locale)
        Sets the locale of the document.
        Parameters:
        locale - the locale of the document.
      • setStructTreeRoot

        public void setStructTreeRoot​(PDFStructTreeRoot structTreeRoot)
        Sets the StructTreeRoot object. Used for accessibility.
        Parameters:
        structTreeRoot - of this document
      • getStructTreeRoot

        public PDFStructTreeRoot getStructTreeRoot()
        Returns the StructTreeRoot object.
        Returns:
        the structure tree root (or null if accessibility is not enabled)
      • makeTagged

        public void makeTagged()
        Marks this document as conforming to the Tagged PDF conventions.
      • getMarkInfo

        public PDFDictionary getMarkInfo()
        Returns the MarkInfo dictionary.
        Returns:
        the MarkInfo dictionary (or null if it's not present)