Class PDFFile

  • All Implemented Interfaces:
    RMArchiver.Archiving, java.lang.Cloneable

    public class PDFFile
    extends RMObject
    This class represents a PDF file.
    • Constructor Detail

      • PDFFile

        public PDFFile()
        Creates a new pfile.
    • Method Detail

      • getVersion

        public java.lang.String getVersion()
        Returns the version of pdf being generated.
      • setVersion

        public void setVersion​(float aVersion)
        Sets the version of the pdf being generated.
      • setAccessPermissions

        public void setAccessPermissions​(java.lang.String ownerPwd,
                                         java.lang.String userPwd,
                                         int accessFlags)
        Sets pdf user access restrictions.

        The user password is the password that will be required to open the file. The owner password is the password that will be required to make future changes to the security settings, such as the passwords. Either of the passwords may be null. If both passwords are null, the file will not be password protected, but it will still be encrypted. Fine-grained access can be limited by setting accessFlags, to limit such things as printing or editing the file. See com.ribs.pdf.PDFSecurityHandler for a list of the access flag constants. (or the pdf spec v1.6, pp. 99-100)

      • setUnmodifiable

        public void setUnmodifiable​(java.lang.String ownerPwd)
        Set the access permissions on the file such that the document can be opened by anyone, but the user cannot modify the document in any way. To modify these settings in Acrobat, the owner password would have to be provided.
      • getBytesPDF

        public byte[] getBytesPDF​(RMDocument aDoc)
        Returns a PDF byte array for a given RMDocument.
      • getXRefTable

        public PDFXTable getXRefTable()
        Returns the cross reference table.
      • getInfoDict

        public java.util.Map getInfoDict()
        Returns the PDF file's info dictionary.
      • getPagesTree

        public PDFPagesTree getPagesTree()
        Returns the PDF file's pages tree.
      • setAuthor

        public void setAuthor​(java.lang.String s)
        Sets the author of the pdf file.
      • setCreator

        public void setCreator​(java.lang.String s)
        Sets the creator of the pdf file.
      • getFileID

        public byte[] getFileID()
        Generates and returns a unique file identifier.
      • getFileIDString

        public java.lang.String getFileIDString()
        Returns the file identifier as a hex string.
      • getFonts

        public java.util.Map getFonts()
        Returns the pdf file's fonts.
      • getFontEntry

        public PDFText.FontEntry getFontEntry​(RMFont aFont)
        Returns the pdf font entry for a specific font.
      • addFont

        public void addFont​(RMFont aFont,
                            int fontCharSet)
        Adds a font.
      • getImages

        public java.util.Map getImages()
        Returns the images for the pdf file.
      • addImageData

        public void addImageData​(RMImageData im)
        Adds an image data to the pdf file.
      • getBuffer

        public PDFBuffer getBuffer()
        Returns the PDF buffer for this PDF file.
      • writeXRefTable

        public int writeXRefTable()
        Writes all entry objects to pdf buffer.
      • writeXRefEntry

        public void writeXRefEntry​(java.lang.Object anObj)
        Writes any kind of object to the PDF buffer.