qax-os / excelize

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
https://xuri.me/excelize
BSD 3-Clause "New" or "Revised" License
17.64k stars 1.69k forks source link

Excel to PDF Page Size issue #1871

Closed Sarsewar closed 3 months ago

Sarsewar commented 3 months ago

Please find attached Demo_Excel.xlsx, which we are currently using to convert to PDF. The conversion process is being conducted directly on DocuSign. However, we've encountered issues regarding page size and scaling, as illustrated in the screenshots below. Despite attempting conversion through other online free platforms specializing in direct XLSX to PDF conversion, we've encountered the same issues. Notably, the same Excel file converts correctly using Microsoft's "Save As" or "Print" functionality.

We have explored various combinations in the worksheet's XML, including adjustments to pageSize, scale, fitToWidth, and fitToHeight, yet none have proven successful. We seek your insights into the possible reasons for these challenges.

fitToPage fitToWidth fitToHeight Scale
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 1 1
0 1 0 1
0 1 1 0
0 1 0 0
1 0 0 0
1 0 0 1
1 0 1 0

image

Your guidance in resolving this matter is greatly appreciated.

xuri commented 3 months ago

Thanks for your issue. Sorry, this problem is out of scope for this library. Maybe there are some compatibility issues in some conversion tools.