We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Generated HTML from PDF Is Empty

Hi Support Team,

I am trying to convert the attached PDF to HTML. Unfortunately the generated HTML is empty. Can you please let me know if this is an issue in the API and by when can we expect a fix.

com.aspose.pdf.License license = new com.aspose.pdf.License();
      license.setLicense(ConvertPDFtoXLSX.class.getClassLoader().getResourceAsStream("Aspose.Pdf.lic"));
      Document doc = new Document(ConvertPDFtoXLSX.class.getClassLoader().getResourceAsStream("test.pdf"));

      // Instantiate HTML Save options object
      HtmlSaveOptions newOptions = new HtmlSaveOptions();
      // Enable option to embed all resources inside the HTML
      newOptions.PartsEmbeddingMode = HtmlSaveOptions.PartsEmbeddingModes.EmbedCssOnly;
      // This is just optimization for IE and can be omitted
      newOptions.LettersPositioningMethod = LettersPositioningMethods.UseEmUnitsAndCompensationOfRoundingErrorsInCss;
      newOptions.RasterImagesSavingMode = HtmlSaveOptions.RasterImagesSavingModes.AsExternalPngFilesReferencedViaSvg;
      // newOptions.FontSavingMode = HtmlSaveOptions.FontSavingModes.SaveInAllFormats

      // Output file path
      String outHtmlFile = "Single_output.html";
      // Save the output file
      doc.save(outHtmlFile, newOptions);

Thanks for you help.

Best regards,
Imran Pariyani
test.pdf (9.2 MB)

@pariyani,

Thanks for sharing further details.

We have logged an investigation ticket as PDFJAVA-39409 in our issue tracking system. We will further look into details of it and keep you posted with the status of its resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFJAVA-39409) have been fixed in Aspose.PDF for Java 20.8.