生成的word格式没有问题,但是在转换为pdf时就出现左右两边没显示完,内容被挤到右边去啦
public static boolean changeWordToPdf(String resourPath,String savePath){
boolean result = true;
try {
Document doc = new Document(resourPath);
PdfSaveOptions options = new PdfSaveOptions();
options.setExportDocumentStructure(true);
doc.save(savePath);
}catch (Exception e) {
e.printStackTrace();
result = false;
}
return result;
}

尝试把
PdfSaveOptions options = new PdfSaveOptions();
options.setExportDocumentStructure(true);
这两行注释掉
解决了吗兄弟
可以试下Spire.Doc for .net控件,我用过,转换效果挺不错,代码操作也简单。
spire.doc for .net产品下载链接: