Error reading PDF documents

Hi!
In your demo (see attached images), reading and converting from PDF documents is supported, but when using this feature, the following error message appears: “Pdf format is not supported on this platform. Use .NET Standard or .NET 4.6.1 or greater version of Aspose.Words for loading Pdf documents.​”.​
Please advice or fix.

(as a remark: a banner indicates that our subscription has expired. This is not true)

public static void main(String[] p_args)
{
    try {
        new AConvertPdf2Md().convert("Export.pdf");
    } catch (Throwable e) {
        e.printStackTrace();
    }
}

private void convert(String sFileName) throws Throwable {
    InputStream sheetStream = AConvertPdf2Md.class.getResourceAsStream(sFileName);
    byte[] aBytes = inputStreamToByteArray(sheetStream);

    Document doc = new Document(new ByteArrayInputStream(aBytes));
    String converted = File.createTempFile("converted", ".md").getAbsolutePath();
    System.out.println("converted to: " + converted);
    doc.save(converted);
}

@THaase

Summary
You are trying to load a PDF with Aspose.Words for Java. The Java edition of Aspose.Words does not include PDF import functionality, so the runtime throws the message “Pdf format is not supported on this platform…”. The banner that mentions an expired subscription is shown when a valid license is not loaded, but it is unrelated to the PDF‑import limitation.

Why it happens

  • Platform limitation – PDF loading is only implemented in Aspose.Words for .NET. The Java API cannot read PDF files directly.
  • License banner – If the license file is missing or not loaded, Aspose displays a banner indicating an expired or invalid subscription. This does not affect the ability (or inability) to read PDFs.

What to do next

  1. Load a valid license before creating any Aspose objects, e.g.:
import com.aspose.words.License;
License lic = new License();
lic.setLicense("Aspose.Words.Java.lic"); // ensure the .lic file is on the classpath or give an absolute path

This will remove the subscription‑banner message.
2. Use a product that supports PDF import – Since Aspose.Words for Java cannot read PDFs, you need to employ a different library or Aspose product that does support PDF loading (e.g., Aspose.PDF for Java) to first convert the PDF to a format that Aspose.Words can handle (such as DOCX) and then continue with your Markdown conversion.
3. If you stay on Java, consider one of the following approaches:

  • Convert the PDF to DOCX or plain text with a library that supports PDF, then load the resulting file with Aspose.Words for further processing.
  • Use a third‑party PDF‑to‑Markdown converter if you only need Markdown output.
  1. If you can switch to .NET, the .NET version of Aspose.Words does support loading PDF directly, so the same code would work without the platform error.

Provide additional details (JDK version, OS, license status) if you need more specific guidance.

:warning: I could not fully verify this explanation against the retrieved sources. Please double-check the behaviour in your environment and confirm the exact SDK/version.

This was a very bad, unmotivated AI generated answer, not fulfilling our paid support contract.

@THaase Aspose.Words for java does not support loading PDF documents. This feature is supported only in .NET and Python versions of Aspose.Words.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSJAVA-3207

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

As workaround you can use Aspose.Pdf for Java library for converting Pdf to Docx and after that use Aspose.Words for Java
https://docs.aspose.com/pdf/java/convert-pdf-to-word/#convert-pdf-to-doc
https://docs.aspose.com/pdf/java/convert-pdf-to-word/#how-to-convert-pdf-to-docx