Hello @alexey.noskov,
my demo from https://products.aspose.com/html/zh/java/conversion/:
public class Test3 {
public static void main(String[] args) {
String documentPath = “/index.html”;
String outputPath = “/indexNew.pdf”;
// Source HTML document
com.aspose.html.HTMLDocument htmlDocument = new com.aspose.html.HTMLDocument(documentPath);
// Initialize PdfSaveOptions
com.aspose.html.saving.PdfSaveOptions options = new com.aspose.html.saving.PdfSaveOptions();
options.setJpegQuality(100);
// Output file path
// Convert HTML to PDF
com.aspose.html.converters.Converter.convertHTML(htmlDocument, options, outputPath);
}
}
version:23.1
java:1.8
os:mac
Exception in thread “main” java.lang.AssertionError: Cannot read a name from the name table in a font.
at com.aspose.html.internal.ms.System.Diagnostics.Debug.fail(Unknown Source)
at com.aspose.html.internal.p234.z1.fail(Unknown Source)
at com.aspose.html.internal.p127.z26.m201(Unknown Source)
at com.aspose.html.internal.p127.z26.m1563(Unknown Source)
at com.aspose.html.internal.p127.z26.m2(Unknown Source)
at com.aspose.html.internal.p127.z11.m1(Unknown Source)
at com.aspose.html.internal.p127.z11.(Unknown Source)
at com.aspose.html.internal.p127.z8.m1518(Unknown Source)
at com.aspose.html.internal.p127.z8.m1516(Unknown Source)
at com.aspose.html.internal.p127.z8.m123(Unknown Source)
at com.aspose.html.internal.p125.z1.m123(Unknown Source)
at com.aspose.html.internal.p189.z1.m1(Unknown Source)
at com.aspose.html.internal.p189.z1.m1(Unknown Source)
at com.aspose.html.internal.p189.z1.m1(Unknown Source)
at com.aspose.html.internal.p241.z119.m1(Unknown Source)
at com.aspose.html.internal.p252.z20.(Unknown Source)
at com.aspose.html.internal.p241.z119.(Unknown Source)
at com.aspose.html.internal.p241.z65.m1(Unknown Source)
at com.aspose.html.internal.p133.z16$30.m2(Unknown Source)
at com.aspose.html.internal.p133.z16$30.m1(Unknown Source)
at com.aspose.html.internal.p133.z16$6$1.invoke(Unknown Source)
at com.aspose.html.internal.p31.z1.dispose(Unknown Source)
at com.aspose.html.internal.p31.z3.dispose(Unknown Source)
at com.aspose.html.internal.p160.z4.m1(Unknown Source)
at com.aspose.html.internal.p160.z2.m7(Unknown Source)
at com.aspose.html.internal.p174.z7.m2338(Unknown Source)
at com.aspose.html.internal.p174.z7.moveNext(Unknown Source)
at com.aspose.html.internal.p209.z1.m1(Unknown Source)
at com.aspose.html.rendering.HtmlRenderer.render(Unknown Source)
at com.aspose.html.rendering.HtmlRenderer.render(Unknown Source)
at com.aspose.html.rendering.HtmlRenderer.render(Unknown Source)
at com.aspose.html.rendering.Renderer.render(Unknown Source)
at com.aspose.html.rendering.Renderer.render(Unknown Source)
at com.aspose.html.converters.z5.m1(Unknown Source)
at com.aspose.html.converters.z5.m1(Unknown Source)
at com.aspose.html.converters.z5.m1(Unknown Source)
at com.aspose.html.converters.Converter.convertHTML(Unknown Source)
at com.example.aspose.Test2.main(Test2.java:25)