PSPDFURLAction


@interface PSPDFURLAction : PSPDFAction

Opens a URL target. This can be similar to a PSPDFRemoteGoToAction if a pspdfkit:// URL with a page target is used.

  • Initializes with string, will convert to URL automatically.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithURLString:(nonnull NSString *)URLString;

    Swift

    init(urlString URLString: String)
  • Initializes with URL and options. options keys are PSPDFActionOption*.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithURL:(nullable NSURL *)URL
                                options:(nullable NSDictionary<NSString *, id> *)
                                            options;

    Swift

    init(url URL: URL?, options: [String : Any]? = nil)
  • URL

    The annotation URL target.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSURL *URL;

    Swift

    var url: URL? { get }
  • The unmodified and unparsed URL.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSURL *unmodifiedURL;

    Swift

    var unmodifiedURL: URL? { get }
  • This will convert pspdfkit:// URLS or localhost-URLs that use path tokens into their expanded form, and will override the options dictionary with any option found in the URL. If the URL has already been processed, this will not do anything. - returns: YES if the URL has been updated.

    Declaration

    Objective-C

    - (BOOL)updateURLWithAnnotationManager:
        (nonnull PSPDFAnnotationManager *)annotationManager;

    Swift

    func updateURL(with annotationManager: PSPDFAnnotationManager) -> Bool

    Return Value

    YES if the URL has been updated.

  • Returns YES if the URLString has been prefixed with pspdfkit:// or another defined prefix set in PSPDFDocument.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL isPSPDFPrefixed;

    Swift

    var isPSPDFPrefixed: Bool { get }
  • The page index, if defined in the options dictionary.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) NSUInteger pageIndex;

    Swift

    var pageIndex: UInt { get set }
  • Indicator if modal is set in options. Will add modal to options if setModal: is used.

    Declaration

    Objective-C

    @property (getter=isModal, assign, readwrite, nonatomic) BOOL modal;

    Swift

    var isModal: Bool { get set }
  • Indicator if popover is set in options. Will add popover to options if setPopover: is used.

    Declaration

    Objective-C

    @property (getter=isPopover, assign, readwrite, nonatomic) BOOL popover;

    Swift

    var isPopover: Bool { get set }
  • Indicator if button is set in options. Will add button to options if setButton: is used.

    Declaration

    Objective-C

    @property (getter=isButton, assign, readwrite, nonatomic) BOOL button;

    Swift

    var isButton: Bool { get set }
  • Tries to extract a size out of options size. Returns CGSizeZero if conversion fails.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGSize size;

    Swift

    var size: CGSize { get set }
  • Video offset.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGFloat offset;

    Swift

    var offset: CGFloat { get set }
  • Regenerates a pspdfkit:// style string IF isPSPDFPrefixed is set.

    Declaration

    Objective-C

    - (nullable NSString *)prefixedURLStringWithAnnotationManager:
        (nonnull PSPDFAnnotationManager *)annotationManager;

    Swift

    func prefixedURLString(with annotationManager: PSPDFAnnotationManager) -> String?
  • Helper to determine if the URL is an email and to configure the mail controller for email, subject, cc, bcc and body.

    Declaration

    Objective-C

    @property (readonly, getter=isEmailURL, nonatomic) BOOL emailURL;

    Swift

    var isEmailURL: Bool { get }
  • Determines whether the URL points to a local file.

    Declaration

    Objective-C

    @property (readonly, getter=isLocalPDFURL, nonatomic) BOOL localPDFURL;

    Swift

    var isLocalPDFURL: Bool { get }
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFURLAction : PSPDFAction