PDF Moving and Deleting Content

Hi, I am following these guides: PDFTron Systems Inc. | Documentation

but when I get to the part where you enable the tool:

// Enable the tools to edit the PDF content
instance.UI.enableFeatures([instance.Feature.ContentEdit]);

I receive the following typescript error: Property 'Feature' does not exist on type 'WebViewerInstance'.ts(2339)
I am using Webviewer installed via npm, the version is 8.11, according to the guides this should have been available from 8.3, am I missing something in order to activate this feature?

Hi Mark
Happy new year! Since you are using the Webviewer version 8.11. It should work. Is it possible you could share your public repo for me to do more investigation??

Best Regards
Jack

Hi Jack, sorry it is a private repo, but all I did was install via npm, here is my package-lock.json entry:

"node_modules/@pdftron/webviewer": {
      "version": "8.11.0",
      "resolved": "https://registry.npmjs.org/@pdftron/webviewer/-/webviewer-8.11.0.tgz",
      "integrity": "sha512-TWtvSDAvig/7IQq9gqn1SSYL0cpWSfWo5gEsqmNqRc/qUEEsuZUqpSDXi5zQFX0xr5wWnLSQvrnGKK0iJdKWPg=="
    }

Hi Mark
I see that we missed the put the ContentEdit into our type.ts. Could you please just write like this alternatively.

instance.UI.enableFeatures(['ContentEdit']);

We will fix this as soon as possible!

Best Regards
Jack

1 Like

Hi Mark
What’s more, after we fix this the code should be like:
instance.UI.enableFeatures([instance.UI.Feature.ContentEdit]);

Best Regards
Jack

Hi Mark
We fixed the type issue for contentEdit. You could use npm i @pdftron/webviewer@8.11.0-20230107 like the latest build for 8.11. There is more source on the latest nightly build in here PDFTron Systems Inc. | Nightly

please let me know if it is not work for you

Jack

1 Like