i have override ImagingSavingCallback class as below
public class HandleImageSaving implements IImageSavingCallback
{
private HtmlSaveOptions saveOptions;
public HandleImageSaving(HtmlSaveOptions saveOptions) {
this.saveOptions = saveOptions;
}
@Override
public void imageSaving(ImageSavingArgs args) throws Exception
{
// Change any images in the document being exported with the extension of “jpeg” to “jpg”.
if(args.getCurrentShape().getShapeType() == ShapeType.OLE_OBJECT){
saveOptions.setImageResolution(300);
}else{
saveOptions.setImageResolution(96);
}
}
}
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
saveOptions.setExportHeadersFootersMode(0);
saveOptions.setImageSavingCallback(new HandleImageSaving(saveOptions));
saveOptions.setSaveFormat(SaveFormat.HTML);
// saveOptions.setOfficeMathOutputMode(HtmlOfficeMathOutputMode.MATH_ML);
doc.save(folder + “/images/” + fileName + “.html”,saveOptions);
when using this code ,i found that current image doesn’t use the resolution as i set,the next image does,i wondered how to change current image’s resolution dynamicly.