Today, I have a new problem.
code one:
HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions();
// Optional parameters
htmlSaveOptions.setSavePath(“C:\Users\summer\Desktop\FileStructure02\”+ “vdxToHtmlFile/”);
htmlSaveOptions.setPage(2);
String savedPath = null;
System.out.println(“vdx”);
htmlSaveOptions.setSaveName(“GroupDocs_Demo.vdx”);
savedPath = conversionHandler.convertToHtml(“GroupDocs_Demo.vdx”, htmlSaveOptions);
System.out.println(savedPath);
error:
Exception in thread “main” com.groupdocs.conversion.exception.InternalException: Can’t convert to html!
at com.groupdocs.conversion.handler.ConversionHandler.convertToHtml(Unknown Source)
at com.groupdocs.conversion.maven.ConversionSample.main(ConversionSample.java:74)
Caused by: com.groupdocs.conversion.exception.CorruptFileException: File extension html of filename C:/Users/summer/Desktop/FileStructure02/vdxToHtmlFile/GroupDocs_Demo.vdx_2.html cannot be opened, and looks to be corrupted.
at g.toHtml(Unknown Source)
at ab.a(Unknown Source)
at com.groupdocs.conversion.handler.ConversionHandler.convertToHtml(Unknown Source)
… 2 more
Caused by: com.groupdocs.conversion.exception.CorruptFileException: File extension of filename Can’t convert diagram to html! cannot be opened, and looks to be corrupted.
at g.toHtml(Unknown Source)
… 5 more
Caused by: com.groupdocs.conversion.exception.CorruptFileException: File extension of filename Can’t convert pdf to html! cannot be opened, and looks to be corrupted.
at w.toHtml(Unknown Source)
… 6 more
Caused by: class com.groupdocs.conversion.internal.c.a.pd.internal.ms.System.cd: Invalid index: index should be in the range [1…n] where n equals to the pages count.
com.groupdocs.conversion.internal.c.a.pd.db.a(Unknown Source)
com.groupdocs.conversion.internal.c.a.pd.db.d(Unknown Source)
w.toHtml(Unknown Source)
g.toHtml(Unknown Source)
g.toHtml(Unknown Source)
ab.a(Unknown Source)
com.groupdocs.conversion.handler.ConversionHandler.convertToHtml(Unknown Source)
com.groupdocs.conversion.handler.ConversionHandler.convertToHtml(Unknown Source)
com.groupdocs.conversion.maven.ConversionSample.main(ConversionSample.java:74)
at com.groupdocs.conversion.internal.c.a.pd.db.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.db.d(Unknown Source)
… 7 more
code two:
HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions();
// Optional parameters
htmlSaveOptions.setSavePath(“C:\Users\summer\Desktop\FileStructure02\”+ “vdxToHtmlFile/”);
htmlSaveOptions.setPage(1);
String savedPath = null;
System.out.println(“vdx”);
htmlSaveOptions.setSaveName(“GroupDocs_Demo.vdx”);
savedPath = conversionHandler.convertToHtml(“GroupDocs_Demo.vdx”, htmlSaveOptions);
System.out.println(savedPath);
error:
Exception in thread “main” java.lang.ExceptionInInitializerError
at com.groupdocs.conversion.internal.c.a.pd.internal.p218.y.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.internal.p163.d.b(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.internal.p163.d.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.internal.p163.k.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.internal.p163.a.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.internal.p162.t.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.internal.p350.m.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.iZ.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.iZ.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.a.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.ay.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.a.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.ay.a(Unknown Source)
at w.toHtml(Unknown Source)
at g.toHtml(Unknown Source)
at g.toHtml(Unknown Source)
at ab.a(Unknown Source)
at com.groupdocs.conversion.handler.ConversionHandler.convertToHtml(Unknown Source)
at com.groupdocs.conversion.handler.ConversionHandler.convertToHtml(Unknown Source)
at com.groupdocs.conversion.maven.ConversionSample.main(ConversionSample.java:70)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 137
at com.groupdocs.conversion.internal.c.a.pd.internal.p549.a.b(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.internal.p265.b.(Unknown Source)
… 20 more
Only difference:
htmlSaveOptions.setPage(2);
htmlSaveOptions.setPage(1);
I know what this parameter means.But still don’t understand why this kind of wrong.