Apryse viewer throws an error when blob is loaded.

Product:
Apryse
Product Version:
@pdftron/webviewer”: “^10.12.0”,
Please give a brief summary of your issue:
(Think of this as an email subject)
When a blob of a docx file loaded with instance.value.UI.loadDocument it throws an error in Vue 3
Error -->>
Exception during conversion: Exception:
Message: Unable to convert this document from binary to OOXML form. File is not a valid zip archive.Conditional expression: false
Version : 10.12.0-3ccb0992a8
Platform : Emscripten
Architecture : Emscripten
Filename : OfficeFileBase.cpp
Function : Init
Linenumber : 450


blob - type: “application/vnd.openxmlformats-officedocument.wordprocessingml.document”,
extension: docx
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)

  1. Download file and convert it to a js blob.
  2. use instance.UI.loadDocument to load the docx file

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

1 Like

Hello, I’m AiRon, an automated tech support bot :robot:
While you wait for one of our customer support representatives, I can help you with your question.


It seems like you are encountering an issue when trying to load a DOCX file as a Blob in WebViewer, resulting in an error related to the file not being recognized as a valid zip archive. This often happens if the Blob is not correctly formatted or if there’s an issue with how the Blob is created or passed to the WebViewer.

Some things you can try:

  • Ensure that the Blob is correctly created from the DOCX file. Verify that the Blob’s data is properly constructed and represents a valid DOCX file.

  • Check that the Blob is passed with the correct MIME type, which should be “application/vnd.openxmlformats-officedocument.wordprocessingml.document”.

  • Make sure that the file extension is correctly set when loading the document using the loadDocument method.

  • Consider testing with a known good DOCX file to rule out issues with the specific file you are currently using.




Here are some resources that might help you:



Hopefully, this helps you solve your problem while you wait for a human to get back to you.

1 Like

Hello @avishka.palamure,

Thank you for posting on our forum.

If you haven’t already, make sure to set the downloadType option in getFileData() to ‘office’, as well as setting the extension option in loadDocument() to ‘docx’. This will help ensure that WebViewer knows what type of file is being loaded.

If the above doesn’t work, please confirm the following:

  1. DOCX file used for testing
  2. Full code sample used for testing, including the constructor as well as the code for downloading/loading the file.
  3. JavaScript console output showing all warnings and errors.
  4. Network panel showing all failed network traffic
  5. Can you reproduce the issue using our samples (especially on our site)? You can find our Vue sample here: https://github.com/ApryseSDK/webviewer-vue-sample
  6. Does the issue only occur in certain browsers and/or devices? If so what are the details?
  7. Are you using WebViewer Server?

Let us know if the above solution works for you!

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

1 Like