Class CGPDFAccessPermissions


  • public final class CGPDFAccessPermissions
    extends java.lang.Object
    To get access permissions from a CGPDFDocument, call CGPDFDocumentGetAccessPermissions. Setting permissions can only be done using the kCGPDFContextAccessPermissions property in the auxiliary info dictionary passed in to CGPDFContextCreate. Some PDF access permissions are non-strict supersets of other permissions. Granting access to a superset permission also grants access to permission(s) it is a superset of. These permissions are as follows: * Granting kCGPDFAllowsHighQualityPrinting also grants kCGPDFAllowsLowQualityPrinting * Granting kCGPDFAllowsDocumentChanges also grants kCGPDFAllowsCommenting and kCGPDFAllowsFormFieldEntry * Granting kCGPDFAllowsContentCopying also grants kCGPDFAllowsContentAccessibility * Granting kCGPDFAllowsCommenting also grants kCGPDFAllowsFormFieldEntry These relationships don't come from the PDF spec. There is nothing in the spec that says you always get low-quality printing if you've already got high-quality printing. They are just two different bits with no explicit dependencies. However, in practice, the software that most people use to edit PDF permissions only allows creation of PDFs that follow these conventions. In the interest of consistency with how these bits are used in practice, kCGPDFContextAccessPermissions enforces the superset model of PDF permissions. For example, if you try to grant high-quality printing but not low-quality printing, the low-quality bit will get turned on anyway. This does not apply to how permissions are read, however. It's very likely that there exist PDFs that don't follow these conventions. For that reason, when checking permissions, always check for the narrowest one that applies. For example, if you're interested in form field entry, always test for kCGPDFAllowsFormFieldEntry specifically. You can't assume that you have it just because you also have kCGPDFAllowsCommenting or kCGPDFAllowsDocumentChanges.
    • Method Summary

      • Methods inherited from class java.lang.Object

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

      • LowQualityPrinting

        public static final int LowQualityPrinting
        Print at up to 150 DPI
        See Also:
        Constant Field Values
      • HighQualityPrinting

        public static final int HighQualityPrinting
        Print at any DPI
        See Also:
        Constant Field Values
      • DocumentChanges

        public static final int DocumentChanges
        Modify the document contents except for page management
        See Also:
        Constant Field Values
      • DocumentAssembly

        public static final int DocumentAssembly
        Page management: insert, delete, and rotate pages
        See Also:
        Constant Field Values
      • ContentCopying

        public static final int ContentCopying
        Extract content (text, images, etc.)
        See Also:
        Constant Field Values
      • ContentAccessibility

        public static final int ContentAccessibility
        Extract content, but only for the purpose of accessibility
        See Also:
        Constant Field Values
      • Commenting

        public static final int Commenting
        Create or modify annotations, including form field entries
        See Also:
        Constant Field Values
      • FormFieldEntry

        public static final int FormFieldEntry
        Modify form field entries
        See Also:
        Constant Field Values