Mac OS 10.14.4
java version “1.8.0_181”
Java™ SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot™ 64-Bit Server VM (build 25.181-b13, mixed mode)
My Code:
PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.setPageCount(1);
WorksheetCollection worksheets = workbook.getWorksheets();
worksheets.get(0).getPageSetup().setPrintArea("");
workbook.save(os, saveOptions);
last column missed when covert to pdf 归档.zip (124.7 KB)
I have tested your scenario/ case using your template file and sample code and it works fine with v19.5. Your issue is related to missing fonts. It seems the underlying fonts (e.g SimSun) is missing in your system, so kindly do install all the underlying fonts (used in the workbook) in your pc before rendering. See the document for your reference:
Also, I have attached the output PDF file on my pc, it looks ok to me. out1.pdf (79.8 KB)
add font path
FontConfigs.setFontFolder(“fonts”, true);
AND add Callback
saveOptions.setWarningCallback(callback);
still miss column [J] without warning return test2.pdf (89.8 KB)
Good to know that by setting margins figures out your issue. Instead of using margins, I think you may try to add a line to your code segment if it figures out your issue:
e.g Sample code:
..........
PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions,setAllColumnsInOnePagePerSheet(true);
......
Good to know that the suggested line of code works for your needs now. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.