pdftk

package
v8.31.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package pdftk implements gotenberg.PdfEngine using the PDFtk command-line tool. Merges and splits PDF files.

Requires the PDFTK_BIN_PATH environment variable.

See https://gitlab.com/pdftk-java/pdftk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PdfTk

type PdfTk struct {
	// contains filtered or unexported fields
}

PdfTk abstracts the CLI tool PDFtk and implements the gotenberg.PdfEngine interface.

func (*PdfTk) Convert

func (engine *PdfTk) Convert(ctx context.Context, logger *slog.Logger, formats gotenberg.PdfFormats, inputPath, outputPath string) error

Convert is not available in this implementation.

func (*PdfTk) Debug added in v8.17.0

func (engine *PdfTk) Debug() map[string]any

Debug returns additional debug data.

func (*PdfTk) Descriptor

func (engine *PdfTk) Descriptor() gotenberg.ModuleDescriptor

Descriptor returns a PdfTk's module descriptor.

func (*PdfTk) EmbedFiles added in v8.25.0

func (engine *PdfTk) EmbedFiles(ctx context.Context, logger *slog.Logger, filePaths []string, inputPath string) error

EmbedFiles is not available in this implementation.

func (*PdfTk) EmbedFilesMetadata added in v8.31.0

func (engine *PdfTk) EmbedFilesMetadata(ctx context.Context, logger *slog.Logger, metadata map[string]map[string]string, inputPath string) error

EmbedFilesMetadata is not available in this implementation.

func (*PdfTk) Encrypt added in v8.23.1

func (engine *PdfTk) Encrypt(ctx context.Context, logger *slog.Logger, inputPath, userPassword, ownerPassword string) error

Encrypt adds password protection to a PDF file using PDFtk.

func (*PdfTk) Flatten added in v8.16.0

func (engine *PdfTk) Flatten(ctx context.Context, logger *slog.Logger, inputPath string) error

Flatten is not available in this implementation.

func (*PdfTk) Merge

func (engine *PdfTk) Merge(ctx context.Context, logger *slog.Logger, inputPaths []string, outputPath string) error

Merge combines multiple PDFs into a single PDF.

func (*PdfTk) PageCount added in v8.28.0

func (engine *PdfTk) PageCount(ctx context.Context, logger *slog.Logger, inputPath string) (int, error)

PageCount is not available in this implementation.

func (*PdfTk) Provision

func (engine *PdfTk) Provision(ctx *gotenberg.Context) error

Provision sets the module properties.

func (*PdfTk) ReadBookmarks added in v8.28.0

func (engine *PdfTk) ReadBookmarks(ctx context.Context, logger *slog.Logger, inputPath string) ([]gotenberg.Bookmark, error)

ReadBookmarks is not available in this implementation.

func (*PdfTk) ReadMetadata added in v8.3.0

func (engine *PdfTk) ReadMetadata(ctx context.Context, logger *slog.Logger, inputPath string) (map[string]any, error)

ReadMetadata is not available in this implementation.

func (*PdfTk) Rotate added in v8.28.0

func (engine *PdfTk) Rotate(ctx context.Context, logger *slog.Logger, inputPath string, angle int, pages string) error

Rotate rotates all pages of a PDF file by the given angle using PDFtk. Page-specific rotation is not supported; if pages is non-empty, ErrPdfEngineMethodNotSupported is returned.

func (*PdfTk) Split added in v8.15.0

func (engine *PdfTk) Split(ctx context.Context, logger *slog.Logger, mode gotenberg.SplitMode, inputPath, outputDirPath string) ([]string, error)

Split splits a given PDF file.

func (*PdfTk) Stamp added in v8.28.0

func (engine *PdfTk) Stamp(ctx context.Context, logger *slog.Logger, inputPath string, stamp gotenberg.Stamp) error

Stamp applies a stamp (on top of page content) to a PDF file using PDFtk. Only PDF source is supported.

func (*PdfTk) Validate

func (engine *PdfTk) Validate() error

Validate validates the module properties.

func (*PdfTk) Watermark added in v8.28.0

func (engine *PdfTk) Watermark(ctx context.Context, logger *slog.Logger, inputPath string, stamp gotenberg.Stamp) error

Watermark applies a watermark (behind page content) to a PDF file using PDFtk. Only PDF source is supported.

func (*PdfTk) WriteBookmarks added in v8.28.0

func (engine *PdfTk) WriteBookmarks(ctx context.Context, logger *slog.Logger, inputPath string, bookmarks []gotenberg.Bookmark) error

WriteBookmarks is not available in this implementation.

func (*PdfTk) WriteMetadata added in v8.3.0

func (engine *PdfTk) WriteMetadata(ctx context.Context, logger *slog.Logger, metadata map[string]any, inputPath string) error

WriteMetadata is not available in this implementation.

Jump to

Keyboard shortcuts

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