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

Free Support Forum - aspose.com

Convert PDF to HTML using Aspose.PDF for Java - could not find the “PartsEmbeddingModes” property

Hello.

I am using Aspose for JAVA version.
I am having the same issue as this post - I want to convert a PDF to HTML with css data embedded in a tag inside the html file and not as a separated file.

but I am using JAVA and I couldn’t find the “PartsEmbeddingModes” property. I get a syntax error that PartsEmbeddingMode and PartsEmbeddingModes cannot be resolved or is not a field.

My code: (The two bolded properties are not recognized)

com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(inStream);
HtmlSaveOptions options = new HtmlSaveOptions(SaveFormat.Html);
options.PartsEmbeddingMode = HtmlSaveOptions.PartsEmbeddingModes.EmbedCssOnly;
options.RasterImagesSavingMode = HtmlSaveOptions.RasterImagesSavingModes.AsEmbeddedPartsOfPngPageBackground;
pdfDocument.save(mainHtmlFile.getAbsolutePath(), options);


Can you help me please?

Tami










Hi Tami,

Thanks for contacting support.

I have tested the scenario using Aspose.PDF for Java 20.5 in Eclipse Juno Application running over Windows 7 (x64) with JDK 1.7 and I am unable to notice any issue. The conversion is properly being performed. Can you please try using the latest release and in case you still face any issue, please feel free to contact. We are sorry for this inconvenience.

Thanks,

It was because of an earlier version. I upgraded it and it is working.

Hi Tami,


Thanks for your inquiry. It seems you are using some old JAR of Aspose.Pdf for Java, so getting the issue. Please download and try latest version of Aspose.Pdf for Java, it will resolve the issue.

Please feel free to contact us for any further assistance.

Best Regards,