How to display Office and Image using PDFNet

WebViewer Version:
10.3.0
Do you have an issue with a specific file(s)?
No.
Can you reproduce using one of our samples or online demos?
No.
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:
(Think of this as an email subject)

How to display Office and Image using PDFNet

Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)

I referred to this content.

With this method, I was able to check the apply redaction of the PDF.
However, Office files and Image files could not be displayed in the first place.

This is error message at the time.
"Exception: \n\t Message: PDF header not found. The file is not a valid PDF document.\n\t Filename: Parser.cpp\n\t Function: SkipHeader\n\t Linenumber: �ֿѴ�\u000bI��?"

Could you please provide sample code that can display Office files and Image files using PDFNet?

Best Regards.

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

Thank you for posting your question to our forum. We will provide you with an update as soon as possible.

1 Like

Hi there,

It looks like you marked this post as solved, has this issue been resolved for you?

The exception ‘PDF header not found. The file is not a valid PDF document.’ usually means there is something wrong/malformed with the PDF. It looks like this method seems to fail because you are using an office document. You will want to make the conversion and then apply the redaction.

Best regards,
Kevin Kim

1 Like

Hi,
Yes thank you!

Best Regards.