PSPDFURLAction

Objective-C


@interface PSPDFURLAction : PSPDFAction

Swift

class URLAction : Action

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 Action.Option.

    Declaration

    Objective-C

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

    Swift

    init(url URL: URL?, options: [Action.Option : Any]? = nil)
  • URL

    The annotation URL target.

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, 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.

    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 Document.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isPSPDFPrefixed;

    Swift

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

    Declaration

    Objective-C

    @property (nonatomic) PSPDFPageIndex pageIndex;

    Swift

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

    Declaration

    Objective-C

    @property (nonatomic, getter=isModal) 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 (nonatomic, getter=isPopover) 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 (nonatomic, getter=isButton) 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 (nonatomic) CGSize size;

    Swift

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

    Declaration

    Objective-C

    @property (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 (nonatomic, readonly, getter=isEmailURL) BOOL emailURL;

    Swift

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

    Declaration

    Objective-C

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

    Swift

    var isLocalPDFURL: Bool { get }