PSPDFXFDFAnnotationProvider


@interface PSPDFXFDFAnnotationProvider : PSPDFContainerAnnotationProvider

Concrete implementation of the PSPDFAnnotationProvider protocol that uses a XFDF file as a source. The XFDF file needs to be local and in a writable location, not on a web server. This annotation provider handles data form fields according to the XFDF spec: An XFDF file with form data contains form field names and values. When importing XFDF into Acrobat, the target PDF file must already contain the form fields. Importing XFDF updates the form field values in the PDF file. Exporting to XFDF puts the current value of the field in the value element. Using XFDF, it is not possible to create a new form field in a PDF document, or change anything other than the value of an existing form field. It compliments an existing data form fields from PDF with values from the XFDF file. If data form field value is not found in the XFDF file it will be served by this provider with the default value. - note: Requires the PSPDFFeatureMaskAnnotationEditing feature flag.

  • Designated initializers.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDocumentProvider:
        (nonnull PSPDFDocumentProvider *)documentProvider;

    Swift

    init(documentProvider: PSPDFDocumentProvider)
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFXFDFAnnotationProvider : PSPDFContainerAnnotationProvider
  • The XFDF file URL.

    Declaration

    Objective-C

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

    Swift

    var fileURL: URL? { get }
  • The input stream. If you set fileURL, this is automatically set for you.

    Declaration

    Objective-C

    @property (readonly, atomic, nullable) NSInputStream *inputStream;

    Swift

    var inputStream: InputStream? { get }
  • The output stream. If you set fileURL, this is automatically set for you.

    Declaration

    Objective-C

    @property (readonly, atomic, nullable) NSOutputStream *outputStream;

    Swift

    var outputStream: OutputStream? { get }
  • Will force-load annotations. Usually invoked lazily. Use hasLoadedAnnotationsForPageAtIndex: with any page (usually page 0) to detect if the annotations have been loaded yet.

    Declaration

    Objective-C

    - (void)loadAllAnnotations;

    Swift

    func loadAllAnnotations()
  • This block will be called when we first access inputStream. The default implementation will create a default input stream from fileURL.

    Declaration

    Objective-C

    @property (readwrite, copy, atomic, nullable) NSInputStream *_Nonnull (^)
        (PSPDFXFDFAnnotationProvider *_Nonnull) createInputStreamBlock;

    Swift

    var createInputStreamBlock: ((PSPDFXFDFAnnotationProvider) -> InputStream)? { get set }
  • This block will be called when we first access outputStream. The default implementation will create a default output stream from fileURL.

    Declaration

    Objective-C

    @property (readwrite, copy, atomic, nullable) NSOutputStream *_Nonnull (^)
        (PSPDFXFDFAnnotationProvider *_Nonnull) createOutputStreamBlock;

    Swift

    var createOutputStreamBlock: ((PSPDFXFDFAnnotationProvider) -> OutputStream)? { get set }