Convert an XLSX Workbook to PDF
Converting an .xlsx to PDF slices an unbounded spreadsheet grid into fixed pages, which is why the raw result so often arrives with columns orphaned onto separate sheets. The fix is three settings made before export: a print area that excludes scratch data, "fit to 1 page wide" scaling, and a repeated header row. This page shows those settings in Excel, the same conversion in LibreOffice including a batch command line, and what happens to formulas, gridlines, and multiple sheets.
Paginating a spreadsheet correctly needs a calculation and layout engine that can evaluate formulas, measure formatted cells, and honor print areas — a full Excel-class engine that browsers do not provide to local pages. The methods below use real engines and get the page breaks right.
Disclosure: this page contains affiliate placeholder links. If they were live, we could earn a commission at no extra cost to you.
AFFILIATE PLACEHOLDER: Recommended desktop PDF suite (placeholder link)
How to convert an XLSX to PDF (step by step)
Method 1 — Excel, with the page setup done properly
- Select the cell range that matters, then choose Page Layout → Print Area → Set Print Area so empty columns and scratch data are excluded.
- Still on the Page Layout tab, set Width: 1 page under Scale to Fit, and leave Height on Automatic so long tables flow onto more pages instead of shrinking.
- Open Page Layout → Print Titles and set Rows to repeat at top (e.g.
$1:$1) so every PDF page carries the column headings. - Go to File → Export → Create PDF/XPS, click Options, choose Active sheet or Entire workbook, then click Publish.
Check the result in View → Page Break Preview first — the dashed blue lines show exactly where the exporter will cut.
Method 2 — LibreOffice Calc, interactive or headless
Calc reads .xlsx page setup, so a workbook prepared as above converts correctly via File → Export As → Export as PDF. For batches:
soffice --headless --convert-to pdf --outdir ./out ledger.xlsx
soffice --headless --convert-to pdf --outdir ./out *.xlsx
Headless conversion uses each file's saved print areas and scaling — set them once in the workbook and every future export is right.
Method 3 — Print to PDF for a quick one-off
- File → Print, printer Microsoft Print to PDF (or macOS Save as PDF).
- In the settings underneath, switch No Scaling to Fit All Columns on One Page.
Fast, but it ignores export-only options such as PDF/A and produces no document structure tags.
How it works
An .xlsx is a ZIP of XML parts (OOXML SpreadsheetML): one sheetN.xml per worksheet holding rows of typed cell values and formulas, a shared-strings table so repeated text is stored once, and a styles part with number formats. Nothing in the file is a page. Two worksheet elements drive pagination: the optional print area (a named range like Sheet1!$A$1:$H$120) and the page-setup record storing paper size, orientation, and either a scale percentage or fit-to-width/height counts.
At export time the engine first recalculates, then formats every cell through its number format (the stored value 44927.0 might print as 01/01/2023), measures the resulting strings with printer font metrics, and walks the grid placing column boundaries against the printable width. With "fit to 1 page wide" it computes the single scale factor that makes the print area's total column width fit, and applies the same factor vertically. Each resulting tile becomes a PDF page of positioned text runs, border lines, and fill rectangles — real vector content, not a screenshot, so text stays selectable.
The lossy part is semantic: PDF has no cells. Formulas, references, data validation, and filtering are gone; only the formatted appearance survives. Charts fare well because they are DrawingML vector objects and export as scalable line-and-fill graphics rather than bitmaps.
Worked example: a 480-row expense ledger
Test file: expenses-2025.xlsx, 312 KB — one sheet of 480 rows × 14 columns (A through N), a summary block off to the side in columns P–S, and one embedded column chart. A naive File → Export with no setup produced a messy 22-page PDF: columns A–J on eleven pages, K–N orphaned on eleven more, plus the scratch summary block. After setting the print area to A1:N481, Width to 1 page, and $1:$1 as the repeating title row, the export produced a clean expenses-2025.pdf of 12 pages, 96 KB, at an automatic scale of 71%, headings on every page, and the chart appended crisply as vector art. The same prepared file via soffice --headless --convert-to pdf gave 12 pages within 1 KB of the same size.
Frequently asked questions
Why are columns cut off when I convert Excel XLSX to PDF?
An .xlsx sheet is an unbounded grid, so the exporter slices it into pages at the default paper width and any columns past the first slice land on later pages. Set Width to 1 page under Page Layout, Scale to Fit, or select the range and set a print area before exporting.
How do I convert all sheets of a workbook into one PDF?
In Excel's File, Export, Create PDF/XPS dialog click Options and choose Entire workbook; every visible sheet is appended into a single PDF in tab order. Hidden sheets are skipped, and each sheet keeps its own page setup.
Do Excel formulas keep working in the PDF?
No, a PDF stores only the displayed results as text; formulas, cell references, and recalculation do not exist in the output. The values are frozen exactly as they appeared at export time, including the formatting applied to them.
How do I show gridlines and headings in the exported PDF?
Gridlines are a screen aid and are omitted by default; on the Page Layout tab tick Print under Gridlines, and Print under Headings for the A-B-C and 1-2-3 labels. Cell borders you drew yourself always print regardless of these settings.
Can I batch-convert XLSX files to PDF without Excel?
Yes, LibreOffice converts unattended with soffice --headless --convert-to pdf --outdir ./out *.xlsx, honoring each file's saved print areas and page setup. Set those in the workbook first, otherwise Calc paginates the whole used range at default scaling.
Why is one cell showing ### in my PDF?
A numeric cell prints ### when its column is too narrow for the formatted value, and export can trigger this even when the screen looked fine because printer font metrics differ slightly. Widen the column or select the data and use Format, AutoFit Column Width before exporting.