Pdftron message header not found when opening a file with extension capitalized(DOCX)

1.4k Views Asked by At

In a windows 8.1 universal app, When opening a file with extension capitalized(eg : DOCX) we get a error "Pdftron message header not found". i.e. during initializing PDFDoc class in pdftron.PDF library. But this works fine for pdf extension capitalized(PDF). This issue does not occur in Android libraries.

We tried instantiating PDFDoc class by passing file as different contents as available in the PDFDoc construtors i.e IStorageFile, IRandomAccessStream, IInputStream, IBuffer, byte[].

Any quick help appreciated.

Thanks in Advance!

1

There are 1 best solutions below

0
On BEST ANSWER

The PDFDoc class only accepts PDF files. You have to first convert the DOCX to PDF.

You can do this by calling OfficeToPdf (or WordToPdf for older versions)