Product: PDFTron SDK jar
Product Version: 9.4.2
Please give a brief summary of your issue:
Error “Input file is of unknown type because file extension is not specified.” when converting from an InputStream
Please describe your issue and provide steps to reproduce it:
I use a trial version of PDFTron SDK to convert PDF files loaded from an InputStream.
Whenever I execute my code I get this error as output:
class com.pdftron.common.PDFNetException: Exception:
Message: An error occurred while converting the file.
Detailed error:
Input file is of unknown type because file extension is not specified.
Conditional expression: false
Version : 9.4.2-a2633dd18a
Platform : Windows
Architecture : AMD64
Filename : Convert.cpp
Function : trn::PDF::Convert::ConvertHelper::OpenDoc
Linenumber : 3128
My code is
Convert.HTMLOutputOptions htmlOutputOptions = new Convert.HTMLOutputOptions();
htmlOutputOptions.setContentReflowSetting(Convert.HTMLOutputOptions.e_reflow_paragraphs);
htmlOutputOptions.setNoPageWidth(true);
PDFDoc doc = new PDFDoc(input.openInputStream());
Convert.toHtml(doc, outputFile.getAbsolutePath(), htmlOutputOptions);