Property 'officeToPDFBuffer' does not exist on type 'typeof Core'

WebViewer Version: 10.9.0

Do you have an issue with a specific file(s)? N/A
Can you reproduce using one of our samples or online demos? N/A
Are you using the WebViewer server? No
Does the issue only happen on certain browsers? No
Is your issue related to a front-end framework? No
Is your issue related to annotations? No

Please give a brief summary of your issue:
Property ‘officeToPDFBuffer’ does not exist on type ‘typeof Core’

Please describe your issue and provide steps to reproduce it:
I’m trying to mimic the example from Generate-via-template | Apryse Documentation to read an Office template without the viewer loaded. I did find a v10 release note that the method name had changed but in my Angular typescript application I’m still not finding the method officeToPDFBuffer on the Core namespace. I’m not sure if this is just a types file issue and maybe the method does exist.

Please provide a link to a minimal sample where the issue is reproducible:

Hello @steve.haney,

Thank you for contacting WebViewer support,

The function name did change from the referenced doc from office2PDFBuffer to officeToPDFBuffer, but still exists on the Core namespace.

You can find the related API docs here: Apryse WebViewer Namespace: Core

To investigate further, please provide the following:

  1. The code sample used to test using officeToPDFBuffer
  2. Are you able to reproduce the issue on one of our samples (especially our site)?
  3. Are you able to access other methods belonging to the Core namespace (such as the annotationManager or documentViewer namespaces, or functions like getVersion())?
  4. Are there any other errors in the console or failed network requests?

Best Regards,
Jacob Romano Carlsen
Web Development Support Engineer
Apryse Software Inc.

Hello @jromanocarlsen @steve.haney

I have a similar problem, but with UI.Components: I get the message "Property ‘Components’ does not exist on type ‘typeof UI’.

I noticed having access to all UI namespaces except Components and Flyout (according to the complete list provided in the doc, see below).

image

I also have 10.9.0 installed. I also have the problem with officeToPDFBuffer.

Thanks!

Cathy C.

Steps to reproduce.

OS: Mac

Create an empty JS project (I just used npm init in VS Code)

Run npm install @pdftron/webviewer

Create an index.ts file. Add some code referencing Core from pdf tron lib and notice the officeToPDFBuffer does not appear as an option. Based on documentation its a static so it should show up on Core.

Other static functions listed in documentation such as isDemoMode do appear.

image

Hello @steve.haney and @catcot20 ,

Thank you for contacting WebViewer support.

If you are trying to access Core functions directly without a viewer, we recommend using the following guide to do so: Without-viewer | Apryse Documentation

This will allow you to access the functions you are looking for under Core.

Let me know if you have any further questions regarding this issue or need any clarification.

Best Regards,
Jacob Romano Carlsen
Web Development Support Engineer
Apryse Software Inc.

As for the components issue @catcot20, if you are trying to access UI components, you can check out these guides to set up the project in a way that you have access to UI.Components:

If you are still running into issues, feel free to provide a sample project, along with steps to setup and run the project so we can investigate further.

Best Regards,
Jacob Romano Carlsen
Web Development Support Engineer
Apryse Software Inc.

Hi @jromanocarlsen,

Thanks for the suggestion but I think the issue is in the npm distribution type file. A node typescript project isn’t affected in terms of how the viewer or libs are called in code. The import of @pdftron/webviewer is the driver for what intellisense and validation I get from typescript type checking.

Is there another import path from my node_modules that I should be using in order to see the Core.officeToPDFBuffer function?

Thanks,
Steve

Hello @steve.haney ,

In order to use all of the APIs and classes in the Core namespace, the static assets (workers) need to be set up in a public location that will be served via HTTP/HTTPS (usually a dist or build folder) and the worker path needs to be set.

See this section of our viewerless guide for more information: Without-viewer | Apryse Documentation

The static files are located within the node_modules/@pdftron/webviewer/public folder. Where are these files in your typescript project?

Best Regards,
Jacob Romano Carlsen
Web Development Support Engineer
Apryse Software Inc.

Attached is the types.d.ts file which gets installed under node_modules/@pdftron/webviewer. This file does not have any reference to officeToPDFBuffer in it. This is what drives the typescript intellisense.

Thanks,
Steve
types.d.ts (2.3 MB)

Hello @steve.haney,

Thank you for the clarification.

We were able to confirm the officeToPDFBuffer function exists but is not currently in our types.d.ts file.

We’ve raised this to our development team to investigate further.

Thank you for bringing this to our attention.

Best Regards,
Jacob Romano Carlsen
Web Development Support Engineer
Apryse Software Inc.