Repository navigation
Page Layout
huzpsb edited this page Oct 25, 2026
·
1 revision
Control how viewers lay out pages when the document is opened.
Values:
| Value | Meaning |
|---|---|
SinglePage |
one page at a time (default) |
OneColumn |
continuous column |
TwoColumnLeft |
two columns, odd pages left |
TwoColumnRight |
two columns, odd pages right |
TwoPageLeft |
two pages at a time, odd left |
TwoPageRight |
two pages at a time, odd right |
pdfcpu2 pagelayout list in.pdf
pdfcpu2 pagelayout set in.pdf TwoPageLeft
pdfcpu2 pagelayout reset in.pdf
cat ebook.pdf | pdfcpu2 pagelayout set - TwoPageLeft - > ebook-spreads.pdfpackage main
import (
"context"
"github.com/huzpsb/pdfcpu2/pkg/api"
"github.com/huzpsb/pdfcpu2/pkg/pdfcpu/model"
)
func main() {
ctx := context.Background()
conf := model.NewDefaultConfiguration()
err := api.SetPageLayoutFile(ctx, "in.pdf", "out.pdf", model.PageLayoutTwoPageLeft, conf)
if err != nil {
panic(err)
}
ss, _ := api.ListPageLayoutFile(ctx, "in.pdf", conf)
_ = ss
_ = api.ResetPageLayoutFile(ctx, "in.pdf", "out2.pdf", conf)
}Related: Page Mode, Viewer Preferences.
pdfcpu2 wiki
Getting started
Fork features
Inspect
Document
Pages
Content
Extract
Resources
Security
Viewer
Trust
Developers