25adc6e1f07a951f31586644ec5de786.pdf.zip (1.2 MB)
代码:
System.out.printf(“run here 4\n”);
int pagesCount = pageCollection.size();
for (int i = 1; i <= pagesCount; i++) {
System.out.printf(“run here 5 ->%d\n”, i);
Page p = pdfDocument.getPages().get_Item(i);
System.out.printf(“run here 6 ->%d\n”, i);
Document tmpDoc = new Document();
tmpDoc.setEmbedStandardFonts(true);
System.out.printf(“run here 7 ->%d\n”, i);
tmpDoc.getPages().add§;
System.out.printf(“run here 8 ->%d\n”, i);
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
saveOptions.setFixedLayout(true);
saveOptions.FontSavingMode = HtmlSaveOptions.FontSavingModes.AlwaysSaveAsWOFF;
saveOptions.LettersPositioningMethod = LettersPositioningMethods.UseEmUnitsAndCompensationOfRoundingErrorsInCss;
saveOptions.RasterImagesSavingMode = HtmlSaveOptions.RasterImagesSavingModes.AsEmbeddedPartsOfPngPageBackground;
saveOptions.CssClassNamesPrefix = “st” + Integer.toString(i) + “_”;
System.out.printf(“run here 8.1 ->%d\n”, i);
tmpDoc.save(mHtmlPath.getAbsolutePath() + “/” + “out” + Integer.toString(i) + “.html”, saveOptions);
System.out.printf(“run here 9 ->%d\n”, i);
pdfDocument.close();
pdfDocument.dispose();
tmpDoc.dispose();
pdfDocument = new Document(outPath + PDF_FILENAME);
System.out.printf(“run here 10 ->%d\n”, i);
}
在 tmpDoc.save(mHtmlPath.getAbsolutePath() + “/” + “out” + Integer.toString(i) + “.html”, saveOptions); 这一行的时候报错:java.lang.IllegalStateException: Resource file GBK2K-H not found in assembly
Java版本: 1.8.0_111
系统:CentOS Linux release 7.4.1708
aspose版本: 18.11