merge

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package merge implements PDF merge.

Index

Constants

This section is empty.

Variables

View Source
var ErrCannotMergePDFs = errors.New("cannot merge PDFs")

ErrCannotMergePDFs is returned when the input documents cannot be combined.

Functions

func Bytes

func Bytes(ctx context.Context, pdfs ...[]byte) ([]byte, error)

Bytes merges PDFs from byte slices. It observes ctx between documents.

func BytesSelected added in v0.2.2

func BytesSelected(ctx context.Context, selections ...PageSelection) ([]byte, error)

BytesSelected merges the selected pages of each source PDF into one document, preserving the requested page order. It observes ctx between documents. Unselected pages are removed from the merged page tree; their underlying objects remain in the file so cross-references (for example outline destinations) stay resolvable.

Types

type PageSelection added in v0.2.2

type PageSelection struct {
	PDF   []byte
	Pages []int
}

PageSelection selects zero-based pages of one source PDF. Pages lists the page indexes to include, in output order; indexes may repeat.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL