PSPDFXFDFParser

Objective-C


@interface PSPDFXFDFParser : NSObject

Swift

class XFDFParser : NSObject

Parses an XML in the XFDF standard. http://partners.adobe.com/public/developer/en/xml/XFDF_Spec_3.0.pdf

  • Unavailable

    Not the designated initializer

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Unavailable

    Not the designated initializer

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Designated initializer.

    Declaration

    Objective-C

    - (nonnull instancetype)
        initWithDataProvider:(nonnull id<PSPDFDataProviding>)dataProvider
            documentProvider:(nonnull PSPDFDocumentProvider *)documentProvider;

    Swift

    init(dataProvider: DataProviding, documentProvider: PSPDFDocumentProvider)
  • Parse XML and block until it’s done. Returns the resulting annotations after parsing is finished (which can also be accessed later on). PSPDFFormField will not be returned by this method, but if values were imported they are now set in the appropriate fields on documentProvider.formParser.formFields.

    Warning

    If the XFDF contains annotations with page indicies beyond the length of the document, then warnings will be logged and those annotations will be skip but otherwise parsing will complete successfully. It will not return an error for this case.

    Declaration

    Objective-C

    - (nullable NSArray<PSPDFAnnotation *> *)parseWithError:
        (NSError *_Nullable *_Nullable)error;

    Swift

    func parse() throws -> [Annotation]
  • Return all annotations as array. Annotations are sorted by page.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSArray<PSPDFAnnotation *> *_Nonnull annotations;

    Swift

    var annotations: [Annotation] { get }
  • Returns YES if parsing has ended for dataProvider.

    Declaration

    Objective-C

    @property (readonly) BOOL parsingEnded;

    Swift

    var parsingEnded: Bool { get }
  • The attached document provider.

    Declaration

    Objective-C

    @property (nonatomic, weak, readonly) PSPDFDocumentProvider *_Nullable documentProvider;

    Swift

    weak var documentProvider: PSPDFDocumentProvider? { get }
  • The used data provider.

    Declaration

    Objective-C

    @property (nonatomic, readonly) id<PSPDFDataProviding> _Nonnull dataProvider;

    Swift

    var dataProvider: DataProviding { get }