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

Free Support Forum - aspose.com

Convert Effect Problem

License license = new License();
license.setLicense(new FileInputStream(
"D:\\Landray\\AttConverter\\FileConverter\\AsposeConverter\\HTMLConverter\\config\\license\\Aspose.Total.Java.lic"));
Document pdf = new Document("C:\\Users\\Lixp\\Desktop\\1.pdf");
PdfConverter imgConverter = new PdfConverter(pdf);
int i = 1;
while (imgConverter.hasNextImage()) {
imgConverter.getNextImage("C:\\Users\\Lixp\\Desktop\\1\\1.pdf-" + i
+ ".jpeg");
i++;
}

Hi Xu,


Thanks for using our API’s.

I have tested the scenario and have managed to reproduce same problem. For the sake of correction, I have logged it as PDFNEWJAVA-35779 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

Hi Xu,


Thanks for your patience. We have investigated the issue and found that the reason of the problem is a lack of some not embedded Chinese fonts on the system (FZY3JW–GB1-0 and FZSSJW–GB1-0). These fonts can be substituted by any suitable font (e.g. Droid Sans Fallback). Please check following code snippet for the purpose, hopefully it will help you to accomplish the task.

Document pdf = new Document(“C:\pdftest\宏景软件高校人力资源管理信息系统四折页.pdf”);<o:p></o:p>

com.aspose.pdf.facades.PdfConverter imgConverter = new com.aspose.pdf.facades.PdfConverter(pdf);

FontRepository.getSubstitutions().add(new PDFNEWJAVA_35779Substitution());

int i = 1;

while (imgConverter.hasNextImage()) {

imgConverter.getNextImage(C:\\pdftest\\宏景软件高校人力资源管理信息系统四折页_" + i + "_" + version + ".jpeg");

i++;

}

...

private static class PDFNEWJAVA_35779Substitution extends CustomFontSubstitutionBase {

@Override

public boolean trySubstitute(CustomFontSubstitutionBase.OriginalFontSpecification originalFontSpecification, com.aspose.pdf.Font[] substitutionFont) {

if (originalFontSpecification.getOriginalFontName().startsWith("FZ")) {

System.out.println(originalFontSpecification.getOriginalFontName());

substitutionFont[0] = FontRepository.findFont("Droid Sans Fallback");

return true;

} else {

return false;

}

}

}


Best Regards,