I’ve enabled setPrintHeadings on a worksheet prior to converting it to PDF and I noticed that row IDs that are greater than 999 (i.e. 4 digits) are truncated in the PDF. (see screenshot)
Is there a way to set the row header column width so the row IDs can be fully visible?
@yoohee
By creating a sample file based on the provided information and testing it on the latest version v25.9 using the following sample code, we can obtain the correct results. Please refer to the attachment. sample.zip (217.4 KB)
// Load your Excel file
Workbook workbook = new Workbook(filePath + "sample.xlsx");
// Access the first worksheet
Worksheet worksheet = workbook.getWorksheets().get(0);
// Set the print headings
worksheet.getPageSetup().setPrintHeadings(true);
// Save the workbook as PDF
workbook.save(filePath + "out_java.pdf", SaveFormat.PDF);
If you still find the issue, kindly do share your complete sample (runnable) code and template Excel file (if any) to reproduce the issue on our end, we will check it soon.
I tried again with the sample file you shared and the issue cannot be reproduced. Not sure how it happened initially but since I cannot repro we can close this issue. I will re-report if it happens again.