Error "Input file is of unknown type because file extension is not specified." when converting from an InputStream

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();
      PDFDoc doc = new PDFDoc(input.openInputStream());
      Convert.toHtml(doc, outputFile.getAbsolutePath(), htmlOutputOptions);

Hi Guillaume,

To investigate further could you please provide the input file you are converting to an input stream and trying to convert?

I get the same issue with any PDF file, for instance this one:

Our Convert.toHtml method does not accept buffers or input streams. It only accepts filepaths or the PDFDoc class:

However, our PDFDoc class can be initialized from a buffer or stream:

So the correct workflow here would be to create a PDFDoc class from your buffer/input stream and then pass that PDFDoc instance to the Convert.ToHtml method.