Package apple.pdfkit

Class PDFAnnotation

    • Constructor Detail

      • PDFAnnotation

        protected PDFAnnotation​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • URL

        public NSURL URL()
        URL for the link. May be nil if no URL action associated with link; in this case the -[destination] may be valid. The preferred way though is to call -[PDFAnnotation action] and -[PDFAnnotation setAction:]. Used by annotations type(s): /Link.
      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • action

        public PDFAction action()
        Optional action performed when a user clicks / taps an annotation. PDF readers ignore actions except for those associated with Link or button Widget annotations.
      • addBezierPath

        public void addBezierPath​(UIBezierPath path)
        Add or remove paths from the annotation. Path points are specified in annotation space. Used by annotations type(s): /Ink.
      • alignment

        public long alignment()
        Alignment of text within annotation bounds. Supported: NSLeftTextAlignment, NSRightTextAlignment and NSCenterTextAlignment. Used by annotations type(s): /FreeText, /Widget (field type(s): /Tx).
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • allowsToggleToOff

        public boolean allowsToggleToOff()
        For radio buttons, indicates whether clicking on widget whose state is already On toggles it Off. Used by annotations type(s): /Widget (field type(s): /Btn).
      • annotationKeyValues

        public NSDictionary<?,​?> annotationKeyValues()
        List all key-value pairs for this annotation; returns a deep copy of all pairs. Note that this method will not include a copy of the value for /Parent. This is by design as to avoid introduing a memory cycle. If you would like to get the /Parent propery, use -[PDFAnnotation valueForAnnotationKey:] with key PDFAnnotationKeyParent.
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • backgroundColor

        public UIColor backgroundColor()
        Background color characteristics. Used by annotations type(s): /Widget (field type(s): /Btn, /Ch, /Tx).
      • border

        public PDFBorder border()
        Optional border or border style that describes how to draw the annotation border (if any). For the "geometry" annotations (Circle, Ink, Line, Square), the border indicates the line width and whether to draw with a dash pattern or solid pattern. PDFAnnotation markup types (Highlight, Strikethrough, Underline) ignores the border.
      • bounds

        public CGRect bounds()
        Required for all annotations. The bounding box in page-space of the annotation.
      • buttonWidgetState

        public long buttonWidgetState()
        The current state of a button widget annotation. Used by annotations type(s): /Widget (field type(s): /Btn).
      • buttonWidgetStateString

        public java.lang.String buttonWidgetStateString()
        The string that represents the ON state of a button widget annotation. This should be set when trying to, for example, group together a set of radio buttons with the same field name. When buttons share the same field name, their individual state strings set them apart from one another. Used by annotations type(s): /Widget (field type(s): /Btn).
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • caption

        public java.lang.String caption()
        Label for the button. Applies to kPDFWidgetPushButtonControl only. Used by annotations type(s): /Widget (field type(s): /Btn).
      • choices

        public NSArray<java.lang.String> choices()
        The choices are an array of strings indicating the options (items) in either a list or pop-up menu. Used by annotations type(s): /Widget (field type(s): /Ch).
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • color

        public UIColor color()
        For many annotations ("Circle", "Square") the stroke color. Used for other annotations as well.
      • contents

        public java.lang.String contents()
        A string of text associated with an annotation. Often displayed in a window when the annotation is clicked on ("FreeText" and "Text" especially).
      • copyWithZone

        public java.lang.Object copyWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • destination

        public PDFDestination destination()
        Destination for the link. May be nil if no destination associated with link; in this case the -[URL] may be valid. The preferred way though is to call -[PDFAnnotation action] and -[PDFAnnotation setAction:]. Used by annotations type(s): /Link.
      • drawWithBoxInContext

        public void drawWithBoxInContext​(long box,
                                         CGContextRef context)
        Draw method. Draws in page-space relative to origin of "box" passed in and to the given context
      • endLineStyle

        public long endLineStyle()
      • endPoint

        public CGPoint endPoint()
      • fieldName

        public java.lang.String fieldName()
        Widget annotations backed by form data have (internal) field names with which to associate a value or data. Can also be used for ResetForm actions. Used by annotations type(s): /Widget (field type(s): /Btn, /Ch, /Tx).
      • font

        public UIFont font()
        Font and font color associated with the text field. Used by annotations type(s): /FreeText, /Popup, /Widget (field type(s): /Btn, /Ch, and /Tx).
      • fontColor

        public UIColor fontColor()
        Width of line used to stroke border. Used by annotations type(s): /FreeText, /Widget (field type(s): /Btn, /Ch, and /Tx).
      • hasAppearanceStream

        public boolean hasAppearanceStream()
        Returns YES if the annotation has an appearance stream. Annotations with appearance streams are drawn using their stream. As a result setting many parameters (like -[setColor:] above) will have no visible effect.
      • hasComb

        public boolean hasComb()
        Used to configure combing for PDF text fields. If set, the field is automatically divided into as many equally spaced positions, or combs, as the value of the maximum length of the field. To get the maximum length, use annotaiton key: PDFAnnotationKeyWidgetMaxLen. Used by annotations type(s): /Widget (field type(s): /Tx).
      • hash_static

        public static long hash_static()
      • iconType

        public long iconType()
        The type of icon displayed in the PDF. Supported icons: "Comment", "Key", "Note", "Help", "NewParagraph", "Paragraph" and "Insert". Used by annotations type(s): /Text.
      • initWithBoundsForTypeWithProperties

        public PDFAnnotation initWithBoundsForTypeWithProperties​(CGRect bounds,
                                                                 java.lang.String annotationType,
                                                                 NSDictionary<?,​?> properties)
        Create a custom annotation with bounds, a type (PDFAnnotationSubtype), and an (optional) dictionary of annotation properties.
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • interiorColor

        public UIColor interiorColor()
        Interior color of the annotation. Used by annotations type(s): /Circle, /Line, /Square.
      • isHighlighted

        public boolean isHighlighted()
        The highlight state dictates how the annotation is drawn. For example, if a user has clicked on a "Link" annotation, you should set highlighted to YES and redraw it. When the user lets up, set highlighted to NO and redraw again.
      • isListChoice

        public boolean isListChoice()
        There are two flavors of Choice widget annotations, lists and pop-up menus. This method allow you to differentiate. Used by annotations type(s): /Widget (field type(s): /Ch).
      • isMultiline

        public boolean isMultiline()
        Used to configure multiline PDF text fields. Used by annotations type(s): /Widget (field type(s): /Tx).
      • isOpen

        public boolean isOpen()
        Used to tell if an annotation is open or closed. Used by annotations type(s): /Popup.
      • isPasswordField

        public boolean isPasswordField()
        Used to determine if a PDF text field is a password field. Used by annotations type(s): /Widget (field type(s): /Tx).
      • isReadOnly

        public boolean isReadOnly()
        Determines if a text field should be editable or not. Used by annotations type(s): /Widget (field type(s): /Btn, /Ch, /Tx).
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • lineStyleFromName

        public static long lineStyleFromName​(java.lang.String name)
        Class methods to help with mapping PDFLineStyle to the associated name based on PDF specification Used by annotations type(s): /Line.
      • markupType

        public long markupType()
        Type of mark-up (highlight, strike-out or underline). Changing the markup type also changes the annotations type. Used by annotations type(s): /Highlight, /StrikeOut, /Underline.
      • maximumLength

        public long maximumLength()
        Maximum characters allowed (optional, zero indicates no specified maximum). Used by annotations type(s): /Widget (field type(s): /Tx).
      • modificationDate

        public NSDate modificationDate()
        Optional (-[modificationDate] may return nil). Modification date of the annotation.
      • nameForLineStyle

        public static java.lang.String nameForLineStyle​(long style)
      • new_objc

        public static java.lang.Object new_objc()
      • page

        public PDFPage page()
        Returns the page the annotation is associated with (may return nil if annotation not associated with a page).
      • paths

        public NSArray<? extends UIBezierPath> paths()
        Array of NSBezierPaths / UIBezierPaths that comprise the annotation. Paths are specified in annotation space. Used by annotations type(s): /Ink.
      • popup

        public PDFAnnotation popup()
        Optional (-[popup] may return nil). Not used with links or widgets, a popup annotation associated with this annotation. The bounds and open state of the popup indicate the placement and open state of the popup window.
      • quadrilateralPoints

        public NSArray<? extends NSValue> quadrilateralPoints()
        Array of n * 4 points, packed as NSValue pointValue / CGPointValue, defining n quadrilaterals in page space where n is the number of quad points. The points for each quad are ordered in a 'Z' pattern. That is, the first point should represent the upper left point representing the start of the marked-up text, the next point will be the upper right, the third point will represent the lower left of the text and the last point the lower right. Points are specified relative to the annotation's bound's origin.
      • radiosInUnison

        public boolean radiosInUnison()
        For radio buttons, indicates whether a group of radio buttons will turn on and off in unison; that is if one is checked, they are all checked. If clear, the buttons are mutually exclusive. Used by annotations type(s): /Widget (field type(s): /Btn).
      • removeBezierPath

        public void removeBezierPath​(UIBezierPath path)
      • removeValueForAnnotationKey

        public void removeValueForAnnotationKey​(java.lang.String key)
        Remove the key-value pair from the annotation dictionary. Returns true on successful removal.
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setAction

        public void setAction​(PDFAction value)
        Optional action performed when a user clicks / taps an annotation. PDF readers ignore actions except for those associated with Link or button Widget annotations.
      • setAlignment

        public void setAlignment​(long value)
        Alignment of text within annotation bounds. Supported: NSLeftTextAlignment, NSRightTextAlignment and NSCenterTextAlignment. Used by annotations type(s): /FreeText, /Widget (field type(s): /Tx).
      • setAllowsToggleToOff

        public void setAllowsToggleToOff​(boolean value)
        For radio buttons, indicates whether clicking on widget whose state is already On toggles it Off. Used by annotations type(s): /Widget (field type(s): /Btn).
      • setBackgroundColor

        public void setBackgroundColor​(UIColor value)
        Background color characteristics. Used by annotations type(s): /Widget (field type(s): /Btn, /Ch, /Tx).
      • setBooleanForAnnotationKey

        public boolean setBooleanForAnnotationKey​(boolean value,
                                                  java.lang.String key)
      • setBorder

        public void setBorder​(PDFBorder value)
        Optional border or border style that describes how to draw the annotation border (if any). For the "geometry" annotations (Circle, Ink, Line, Square), the border indicates the line width and whether to draw with a dash pattern or solid pattern. PDFAnnotation markup types (Highlight, Strikethrough, Underline) ignores the border.
      • setBounds

        public void setBounds​(CGRect value)
        Required for all annotations. The bounding box in page-space of the annotation.
      • setButtonWidgetState

        public void setButtonWidgetState​(long value)
        The current state of a button widget annotation. Used by annotations type(s): /Widget (field type(s): /Btn).
      • setButtonWidgetStateString

        public void setButtonWidgetStateString​(java.lang.String value)
        The string that represents the ON state of a button widget annotation. This should be set when trying to, for example, group together a set of radio buttons with the same field name. When buttons share the same field name, their individual state strings set them apart from one another. Used by annotations type(s): /Widget (field type(s): /Btn).
      • setCaption

        public void setCaption​(java.lang.String value)
        Label for the button. Applies to kPDFWidgetPushButtonControl only. Used by annotations type(s): /Widget (field type(s): /Btn).
      • setChoices

        public void setChoices​(NSArray<java.lang.String> value)
        The choices are an array of strings indicating the options (items) in either a list or pop-up menu. Used by annotations type(s): /Widget (field type(s): /Ch).
      • setColor

        public void setColor​(UIColor value)
        For many annotations ("Circle", "Square") the stroke color. Used for other annotations as well.
      • setComb

        public void setComb​(boolean value)
        Used to configure combing for PDF text fields. If set, the field is automatically divided into as many equally spaced positions, or combs, as the value of the maximum length of the field. To get the maximum length, use annotaiton key: PDFAnnotationKeyWidgetMaxLen. Used by annotations type(s): /Widget (field type(s): /Tx).
      • setContents

        public void setContents​(java.lang.String value)
        A string of text associated with an annotation. Often displayed in a window when the annotation is clicked on ("FreeText" and "Text" especially).
      • setDestination

        public void setDestination​(PDFDestination value)
        Destination for the link. May be nil if no destination associated with link; in this case the -[URL] may be valid. The preferred way though is to call -[PDFAnnotation action] and -[PDFAnnotation setAction:]. Used by annotations type(s): /Link.
      • setEndLineStyle

        public void setEndLineStyle​(long value)
      • setEndPoint

        public void setEndPoint​(CGPoint value)
      • setFieldName

        public void setFieldName​(java.lang.String value)
        Widget annotations backed by form data have (internal) field names with which to associate a value or data. Can also be used for ResetForm actions. Used by annotations type(s): /Widget (field type(s): /Btn, /Ch, /Tx).
      • setFont

        public void setFont​(UIFont value)
        Font and font color associated with the text field. Used by annotations type(s): /FreeText, /Popup, /Widget (field type(s): /Btn, /Ch, and /Tx).
      • setFontColor

        public void setFontColor​(UIColor value)
        Width of line used to stroke border. Used by annotations type(s): /FreeText, /Widget (field type(s): /Btn, /Ch, and /Tx).
      • setHighlighted

        public void setHighlighted​(boolean value)
        The highlight state dictates how the annotation is drawn. For example, if a user has clicked on a "Link" annotation, you should set highlighted to YES and redraw it. When the user lets up, set highlighted to NO and redraw again.
      • setIconType

        public void setIconType​(long value)
        The type of icon displayed in the PDF. Supported icons: "Comment", "Key", "Note", "Help", "NewParagraph", "Paragraph" and "Insert". Used by annotations type(s): /Text.
      • setInteriorColor

        public void setInteriorColor​(UIColor value)
        Interior color of the annotation. Used by annotations type(s): /Circle, /Line, /Square.
      • setListChoice

        public void setListChoice​(boolean value)
        There are two flavors of Choice widget annotations, lists and pop-up menus. This method allow you to differentiate. Used by annotations type(s): /Widget (field type(s): /Ch).
      • setMarkupType

        public void setMarkupType​(long value)
        Type of mark-up (highlight, strike-out or underline). Changing the markup type also changes the annotations type. Used by annotations type(s): /Highlight, /StrikeOut, /Underline.
      • setMaximumLength

        public void setMaximumLength​(long value)
        Maximum characters allowed (optional, zero indicates no specified maximum). Used by annotations type(s): /Widget (field type(s): /Tx).
      • setModificationDate

        public void setModificationDate​(NSDate value)
        Optional (-[modificationDate] may return nil). Modification date of the annotation.
      • setMultiline

        public void setMultiline​(boolean value)
        Used to configure multiline PDF text fields. Used by annotations type(s): /Widget (field type(s): /Tx).
      • setOpen

        public void setOpen​(boolean value)
        Used to tell if an annotation is open or closed. Used by annotations type(s): /Popup.
      • setPage_unsafe

        public void setPage_unsafe​(PDFPage value)
        Returns the page the annotation is associated with (may return nil if annotation not associated with a page).
      • setPage

        public void setPage​(PDFPage value)
        Returns the page the annotation is associated with (may return nil if annotation not associated with a page).
      • setPopup

        public void setPopup​(PDFAnnotation value)
        Optional (-[popup] may return nil). Not used with links or widgets, a popup annotation associated with this annotation. The bounds and open state of the popup indicate the placement and open state of the popup window.
      • setQuadrilateralPoints

        public void setQuadrilateralPoints​(NSArray<? extends NSValue> value)
        Array of n * 4 points, packed as NSValue pointValue / CGPointValue, defining n quadrilaterals in page space where n is the number of quad points. The points for each quad are ordered in a 'Z' pattern. That is, the first point should represent the upper left point representing the start of the marked-up text, the next point will be the upper right, the third point will represent the lower left of the text and the last point the lower right. Points are specified relative to the annotation's bound's origin.
      • setRadiosInUnison

        public void setRadiosInUnison​(boolean value)
        For radio buttons, indicates whether a group of radio buttons will turn on and off in unison; that is if one is checked, they are all checked. If clear, the buttons are mutually exclusive. Used by annotations type(s): /Widget (field type(s): /Btn).
      • setReadOnly

        public void setReadOnly​(boolean value)
        Determines if a text field should be editable or not. Used by annotations type(s): /Widget (field type(s): /Btn, /Ch, /Tx).
      • setRectForAnnotationKey

        public boolean setRectForAnnotationKey​(CGRect value,
                                               java.lang.String key)
      • setShouldDisplay

        public void setShouldDisplay​(boolean value)
        Indicates whether the annotation should be displayed on screen (depending upon -[shouldPrint] it may still print).
      • setShouldPrint

        public void setShouldPrint​(boolean value)
        Indicates whether the annotation should be printed or not.
      • setStampName

        public void setStampName​(java.lang.String value)
        Name of stamp annotation. Standard stamps include names like, "Approved", "Draft", "TopSecret", etc. The name must be representable as ASCII. Very little is rendered if the annotation has no appearance stream. Used by annotations type(s): /Stamp
      • setStartLineStyle

        public void setStartLineStyle​(long value)
        Style used for ornaments at the lines start and end (optional, PDF 1.4). Used by annotations type(s): /Line.
      • setStartPoint

        public void setStartPoint​(CGPoint value)
        Points specifying start and end points for line annotation (required). Points are specified in annotation space. Used by annotations type(s): /Line.
      • setType

        public void setType​(java.lang.String value)
        Returns the annotation type (called "Subtype" in the PDF specification since "Annot" is the type). Examples include: "Text", "Link", "Line", etc. Required. Note that you are only allowed to set the type of an annotation once.
      • setURL

        public void setURL​(NSURL value)
        URL for the link. May be nil if no URL action associated with link; in this case the -[destination] may be valid. The preferred way though is to call -[PDFAnnotation action] and -[PDFAnnotation setAction:]. Used by annotations type(s): /Link.
      • setUserName

        public void setUserName​(java.lang.String value)
        Optional (-[userName] may return nil). Name of the user who created the annotation.
      • setValueForAnnotationKey

        public boolean setValueForAnnotationKey​(java.lang.Object value,
                                                java.lang.String key)
        Allows you to set a key-value pair in this annotation's dictionary. Returns true on successful assignment, false on error. Key must be valid for a PDF annotation's object type, and must have a value that is acceptable for the key type. These values can either be an NSString, NSNumber, NSArray of strings or numbers, or an NSDictionary of the previously listed types. Some keys expect a complex type, for example the key "/C" expects a color in the format of an array of 0, 1, 3, or 4 elements, with each element being a floating-point number in the range of 0.0 - 1.0 ). As a convenience, these kind of keys will directly accept NSColor / UIColor values. Other convenience functions provide similar support can be found in PDFAnnotationUtilities header file. Note that you can set the environment variable "PDFKIT_LOG_ANNOTATIONS" to log any key-value assignment failures.
      • setValues

        public void setValues​(NSArray<java.lang.String> value)
        The choices are an array of strings indicating the option’s export values in either a list or pop-up menu. Used by annotations type(s): /Widget (field type(s): /Ch).
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • setWidgetControlType

        public void setWidgetControlType​(long value)
        The type of button widget control type (radio button, push button, or checkbox). Used by annotations type(s): /Widget (field type(s): /Btn).
      • setWidgetDefaultStringValue

        public void setWidgetDefaultStringValue​(java.lang.String value)
        The string value for a widget annotation. Used by annotations type(s): /Widget (field type(s): /Btn, /Ch, /Tx).
      • setWidgetFieldType

        public void setWidgetFieldType​(java.lang.String value)
        The specific field type of a widget annotation (button, choice, or text). Used by annotations type(s): /Widget (field type(s): /Btn, /Ch, /Tx).
      • setWidgetStringValue

        public void setWidgetStringValue​(java.lang.String value)
        The string value for a widget annotation. Used by annotations type(s): /Widget (field type(s): /Btn, /Ch, /Tx).
      • shouldDisplay

        public boolean shouldDisplay()
        Indicates whether the annotation should be displayed on screen (depending upon -[shouldPrint] it may still print).
      • shouldPrint

        public boolean shouldPrint()
        Indicates whether the annotation should be printed or not.
      • stampName

        public java.lang.String stampName()
        Name of stamp annotation. Standard stamps include names like, "Approved", "Draft", "TopSecret", etc. The name must be representable as ASCII. Very little is rendered if the annotation has no appearance stream. Used by annotations type(s): /Stamp
      • startLineStyle

        public long startLineStyle()
        Style used for ornaments at the lines start and end (optional, PDF 1.4). Used by annotations type(s): /Line.
      • startPoint

        public CGPoint startPoint()
        Points specifying start and end points for line annotation (required). Points are specified in annotation space. Used by annotations type(s): /Line.
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • type

        public java.lang.String type()
        Returns the annotation type (called "Subtype" in the PDF specification since "Annot" is the type). Examples include: "Text", "Link", "Line", etc. Required. Note that you are only allowed to set the type of an annotation once.
      • userName

        public java.lang.String userName()
        Optional (-[userName] may return nil). Name of the user who created the annotation.
      • valueForAnnotationKey

        public java.lang.Object valueForAnnotationKey​(java.lang.String key)
        Retrieves a deep copy of the key-value pair based on the given key; key can either be from the keys PDFAnnotationKey, or an appropriate string from the PDF specification.
      • values

        public NSArray<java.lang.String> values()
        The choices are an array of strings indicating the option’s export values in either a list or pop-up menu. Used by annotations type(s): /Widget (field type(s): /Ch).
      • version_static

        public static long version_static()
      • widgetControlType

        public long widgetControlType()
        The type of button widget control type (radio button, push button, or checkbox). Used by annotations type(s): /Widget (field type(s): /Btn).
      • widgetDefaultStringValue

        public java.lang.String widgetDefaultStringValue()
        The string value for a widget annotation. Used by annotations type(s): /Widget (field type(s): /Btn, /Ch, /Tx).
      • widgetFieldType

        public java.lang.String widgetFieldType()
        The specific field type of a widget annotation (button, choice, or text). Used by annotations type(s): /Widget (field type(s): /Btn, /Ch, /Tx).
      • widgetStringValue

        public java.lang.String widgetStringValue()
        The string value for a widget annotation. Used by annotations type(s): /Widget (field type(s): /Btn, /Ch, /Tx).