DaddyNote

UK, Irish and EU money and travel rules, worked through step by step, with the date each figure was checked.

AI how-to notes · 2026-09-18 · last run 2026-09-18 · 한국어 원문

Excel to PDF cuts off the right-hand columns — measuring Fit to 1 page wide on Windows

One line summary

A 12-column table exported to PDF untouched came out as 6 A4 pages, with only the first 5 columns on page 1. Switching the paper to landscape brought it down to 4 pages with 7 columns; adding 「너비: 1페이지」 (Width — 1 page) on top of that put all 12 columns on 2 pages. Orientation alone was not enough — the scaling had to be switched to fit-to-width before the clipping stopped.

Symptoms

Test environment

ItemValue
OSMicrosoft Windows 11 Home 10.0.26200 (build 26200)
ShellPowerShell 7.6.6
ExcelExcel 16.0, build 20326, language code 82
Default printerNe01:에 있는 Hancom PDF — Hancom PDF on port Ne01:
Test fileA dummy sales table we built ourselves — 12 columns × 45 rows (46 including the header), UsedRange A1:L46
Columns거래일자·거래처코드·거래처명·담당자·지역·품목코드·품목명·규격·수량·단가·공급가액·부가세 — date, customer code, customer name, owner, region, item code, item name, spec, quantity, unit price, net amount, VAT
PDF exportExcel COM Worksheet.ExportAsFixedFormat(0, <path>)
Page countingPython 3.12.10 + PyMuPDF 1.28.0

Customer name, owner and region are invented values drawn with random.choice (홍길동·김철수·이영희·박민수 for people, 가나상사·다라산업 and the like for companies — the Korean equivalent of John Doe and Acme Inc.). No company file was opened.

Three export conditions

We exported the same file three ways — untouched, orientation changed only, and orientation plus fit-to-width. Below is the settings part lifted out of the script we actually ran.

$xl = New-Object -ComObject Excel.Application
$xl.Visible = $false
$wb = $xl.Workbooks.Open("$T\E1_매출표.xlsx")
$ws = $wb.Worksheets.Item(1)

# 조건1 — 아무것도 건드리지 않고 저장
$ws.ExportAsFixedFormat(0, "$T\E1_21_a_기본.pdf")

# 조건2 — 용지 방향만 가로 (2 = xlLandscape)
$ws.PageSetup.Orientation = 2
$ws.ExportAsFixedFormat(0, "$T\E1_21_b_가로.pdf")

# 조건3 — 가로 + 너비 1페이지 맞춤
$ws.PageSetup.Zoom = $false
$ws.PageSetup.FitToPagesWide = 1
$ws.PageSetup.FitToPagesTall = $false
$ws.ExportAsFixedFormat(0, "$T\E1_21_c_너비1.pdf")

Then we counted the pages in each PDF and checked how many of the 12 column names appeared in each page's text.

import fitz
headers = ["거래일자","거래처코드","거래처명","담당자","지역","품목코드",
           "품목명","규격","수량","단가","공급가액","부가세"]
doc = fitz.open("E1_21_a_기본.pdf")
p1 = doc[0].get_text()
print(doc.page_count, [h for h in headers if h in p1])

Results

ConditionPaperScalingPDF pagesColumns on page 1Columns pushed off page 1
1 · untouchedPortrait A4 (595×842pt)Zoom=1006 pages5 (거래일자~지역)7
2 · landscapeLandscape A4 (842×595pt)Zoom=1004 pages7 (거래일자~품목명)5
3 · landscape + 1 page wideLandscape A4 (842×595pt)Zoom=False, Wide=12 pagesall 12none

In condition 1 the columns pushed off page 1 were 품목코드·품목명·규격·수량·단가·공급가액·부가세 (item code through VAT). They landed split across pages 3 and 5. Pages 2, 4 and 6 are row continuations, so not one column name appeared on them.

Condition 1 — page 1 of the PDF saved portrait and untouched. It stops at the 지역 (region) column
Condition 1 — page 1 of the PDF saved portrait and untouched. It stops at the 지역 (region) column
Condition 2 — page 1 with the paper switched to landscape. 품목명 (item name) now fits, but it clips again from 규격 (spec) onward
Condition 2 — page 1 with the paper switched to landscape. 품목명 (item name) now fits, but it clips again from 규격 (spec) onward
Condition 3 — page 1 with Fit to 1 page wide on. All 12 columns through 부가세 (VAT) are there
Condition 3 — page 1 with Fit to 1 page wide on. All 12 columns through 부가세 (VAT) are there

Landscape paper alone is not enough

Dumping the PageSetup values in condition 1 gives this.

Orientation      = 1   (1=xlPortrait)
PaperSize        = 9   (9=xlPaperA4)
Zoom             = 100
FitToPagesWide   = 1
FitToPagesTall   = 1

FitToPagesWide was already 1 and it still produced 6 pages. What condition 3 changes relative to condition 2 is Zoom to False and FitToPagesTall to False — and that is when the 12 columns landed on one page.

Orientation      = 2
Zoom             = False
FitToPagesWide   = 1
FitToPagesTall   = False

Conditions 1 and 2 had FitToPagesWide=1 stored and still split the columns across pages, because Zoom=100 was in force. In the 「페이지 설정」 (Page Setup) dialog on screen, 「확대/축소 배율」 (Adjust to) and 「자동 맞춤」 (Fit to) are two radio buttons, so picking one greys out the other's boxes. We did not watch the screen to see which way that radio moves after setting Zoom = $false over COM.

We also measured FitToPagesTall set to False against set to 1.

FitToPagesTallPagesMost common font size inside the PDF
False (height left alone)2 pages7.68pt
1 (height onto one page too)1 page6.36pt

Putting 1 in shrinks it to a single sheet, at the cost of the type dropping from 7.68pt to 6.36pt. That is measured on a 45-row table; we did not measure a table with more rows.

Doing it on screen (Excel 16.0, Korean UI)

On the ribbon it is all one tab — 페이지 레이아웃 (Page Layout). That tab holds five groups: 「테마 / 페이지 설정 / 크기 조정 / 시트 옵션 / 정렬」 (Themes / Page Setup / Scale to Fit / Sheet Options / Arrange).

The 페이지 레이아웃 (Page Layout) tab — the 페이지 설정 group and the 크기 조정 group with Width, Height and Scale
The 페이지 레이아웃 (Page Layout) tab — the 페이지 설정 group and the 크기 조정 group with Width, Height and Scale

For the dialog, click the small arrow at the bottom right of the 「페이지 설정」 group. The window is titled 「페이지 설정」 (Page Setup), and the 'scaling' box on the [페이지] (Page) tab holds the 「확대/축소 배율(A)」 (Adjust to) and 「자동 맞춤(F)」 (Fit to) radio buttons. Fit to is followed by two number boxes — the first is page width, the second is page height. At the moment we captured it, Adjust to was selected, so Fit to's two boxes were greyed out.

The 페이지 설정 dialog, [페이지] tab — Adjust to and Fit to
The 페이지 설정 dialog, [페이지] tab — Adjust to and Fit to

Column names disappearing from page 2 on

The condition 3 PDF was 2 pages, and page 2 carried no column names at all. It starts in the middle of the table, so whoever receives it cannot tell the columns apart. Repeating the header row on every page fixes it.

$ws.PageSetup.PrintTitleRows = '$1:$1'

With that set, the PDF's page 2 also began with 거래일자 | 거래처코드. The same thing on the ribbon is the 인쇄 제목 (Print Titles) button in 페이지 레이아웃 → the 페이지 설정 group. We confirmed from the screenshot that the button sits in that group. We did not open the window it brings up.

Repeating this over many files

For a handful of files the menu above is faster. Scripts only pay off for a whole folder, and then you have to build the file to open and the PDF path to export separately for each file inside the loop, and close each workbook. The snippet above has one fixed path, so dropping it straight into a loop overwrites the same PDF.

Call $xl.Quit() when you are done, and check that no EXCEL process is left behind. Our own logs record processes surviving Quit() several times; on one of those we printed the PID and killed it separately.

What failed

What we did not test

Related notes