Failed to load document. The document is either corrupt or not a valid office document.

309 views
Skip to first unread message

Viczenn Reyes

unread,
Oct 4, 2017, 3:24:16 PM10/4/17
to PDFTron WebViewer
Hi,

I'm receiving this error when loading an office document in the web viewer. Any assistance would be of help.

Justin Jung

unread,
Oct 5, 2017, 1:55:32 PM10/5/17
to PDFTron WebViewer
Hello,

If the url doesn't include the office file extension, then you need to explicitly pass the option documentType: 'office' to WebViewer constructor.
If this doesn't work, please send us the document along with your WebViewer constructor code to investigate further.

Justin Jung
Software Developer
PDFTron Systems Inc.

Viczenn Reyes

unread,
Oct 6, 2017, 2:18:36 PM10/6/17
to PDFTron WebViewer
We're passing an Amazon S3 Url as the file source

self.WebViewer = new PDFTron.WebViewer({
documentId: customerFileId,
documentType: "office",
initialDoc: selectedAssetSourceFile, //Amazon file source
streaming: true,
enableAnnotations: true
}, self.viewerElement);
simple-word_2007.docx

Justin Jung

unread,
Oct 6, 2017, 6:45:14 PM10/6/17
to PDFTron WebViewer
We were able to load the document without any error.
Can you specify which error message you get in the console?

Viczenn Reyes

unread,
Oct 10, 2017, 11:51:24 AM10/10/17
to PDFTron WebViewer
We were able to render the new office file types by explicitly putting the filename when loading the file, it seems our S3 url generator is appending some post-fixes in the URL passed to the web viewer.

Our problem now is that we're unable to view the old office files (doc, ppt, xls) and some files that is required by our client (msg, eps) i tried converting the files to PDF before rendering it but the converter always fails for those file types, I can convert image types (jpg, png, gif, bmp) just fine, except for those types mentioned above. 

Any idea what I can do?

Justin Jung

unread,
Oct 12, 2017, 2:51:57 PM10/12/17
to PDFTron WebViewer
Hello,

Currently we do not support .msg or .eps, and adding support for those types it is not part of our roadmap yet. If it is critical, you could make a request for a custom project to set them in high priority. (https://www.pdftron.com/support/professionalservices.html)

Regarding the old office file viewing, can you elaborate the issue? Do you get any error messages? Which OS are you using to convert? Also, would you be able to send us the conversion code snippet?
Reply all
Reply to author
Forward
0 new messages