Repository navigation
Page Mode
huzpsb edited this page Oct 25, 2026
·
1 revision
Control which panel viewers show when the document is opened.
Values:
| Value | Meaning |
|---|---|
UseNone |
no outline, no thumbnails (default) |
UseOutlines |
document outline (bookmarks) visible |
UseThumbs |
thumbnail images visible |
FullScreen |
full-screen, no UI |
UseOC |
optional content group panel (PDF 1.5+) |
UseAttachments |
attachments panel (PDF 1.6+) |
pdfcpu2 pagemode list in.pdf
pdfcpu2 pagemode set in.pdf UseOutlines
pdfcpu2 pagemode reset in.pdf
cat ebook.pdf | pdfcpu2 pagemode set - UseOutlines - > ebook-outlines.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.SetPageModeFile(ctx, "in.pdf", "out.pdf", model.PageModeUseOutlines, conf)
if err != nil {
panic(err)
}
ss, _ := api.ListPageModeFile(ctx, "in.pdf", conf)
_ = ss
_ = api.ResetPageModeFile(ctx, "in.pdf", "out2.pdf", conf)
}Related: Page Layout, Viewer Preferences, Bookmarks.
pdfcpu2 wiki
Getting started
Fork features
Inspect
Document
Pages
Content
Extract
Resources
Security
Viewer
Trust
Developers