Search code examples
c#pdftronwindows-8.1-universal

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


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!


Solution

  • 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)