附件的文件可以复现此报错
代码如下:
import com.grapecity.documents.excel.SaveFileFormat;
public class demo {
public static void main(String[] args) {
com.grapecity.documents.excel.Workbook workbook = new com.grapecity.documents.excel.Workbook();
workbook.open("C:\\Users\\pwz\\Desktop\\测试1.xlsx");
workbook.getWorksheets().forEach(p->{
p.getPageSetup().setIsPercentScale(false);
p.getPageSetup().setFitToPagesWide(1);
});
String pdfFullName="C:\\Users\\pwz\\Desktop\\测试1.xlsx".replace(".xlsx", ".pdf");
workbook.save(pdfFullName, SaveFileFormat.Pdf);
}
}
|
|