Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API for annotation processing #350

Merged
merged 6 commits into from
Feb 19, 2020
Merged

Conversation

radazzouz
Copy link
Contributor

@radazzouz radazzouz commented Feb 18, 2020

Details

Came up in Z#17532

recording

Usage

// First, save all annotations in the current document.
this.refs.pdfView.saveCurrentDocument().then(success => {
  if (success) {
    // Then, flatten all the annotations
    PSPDFKit.processAnnotations(
      "flatten",
      "all",
      sourceDocumentPath,
      processedDocumentPath
    )
      .then(success => {
        if (success) {
          // And finally, present the newly processed document with flattened annotations.
          PSPDFKit.present(processedDocumentPath, {});
        } else {
          alert("Failed to embed annotations.");
        }
      })
      .catch(error => {
        alert(JSON.stringify(error));
      });
  } else {
    alert("Failed to save current document.");
  }
});

Acceptance Criteria

  • Add javascript API for annotation processing on Android.
  • Add javascript API for annotation processing on iOS.
  • When approved, right before merging, rebase with master and increment the package version in package.json, package-lock.json, samples/Catalog/package.json, and samples/NativeCatalog/package.json (see example commit: 1bf805f).
  • Create a new release (and tag) with the new package version (see https://github.com/PSPDFKit/react-native/releases).

@radazzouz radazzouz self-assigned this Feb 18, 2020
@radazzouz radazzouz force-pushed the rad/annotation-processing branch from d36cad5 to 633bfac Compare February 18, 2020 17:46
@radazzouz radazzouz changed the title Add API for annotation processing on iOS Add API for annotation processing Feb 18, 2020
@radazzouz radazzouz force-pushed the rad/annotation-processing branch from 633bfac to b09439d Compare February 18, 2020 17:56
@radazzouz radazzouz force-pushed the rad/annotation-processing branch from 4f104ee to 6284356 Compare February 18, 2020 22:42
@radazzouz radazzouz force-pushed the rad/annotation-processing branch from 6284356 to c326131 Compare February 18, 2020 22:51
Copy link
Contributor

@irgendeinich irgendeinich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS JS part looks good to me.

Copy link
Contributor

@steviki steviki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS ObjC and JS parts look good to me. 👍

Copy link
Contributor

@simoarpe simoarpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android part looks good

@radazzouz radazzouz merged commit f2bae96 into master Feb 19, 2020
@radazzouz radazzouz deleted the rad/annotation-processing branch February 19, 2020 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants