Documentation
¶
Overview ¶
Package pdfcpu implements gotenberg.PdfEngine using the pdfcpu command-line tool. Merges and splits PDF files.
Index ¶
- type PdfCpu
- func (engine *PdfCpu) Convert(ctx context.Context, logger *slog.Logger, formats gotenberg.PdfFormats, ...) error
- func (engine *PdfCpu) Debug() map[string]any
- func (engine *PdfCpu) Descriptor() gotenberg.ModuleDescriptor
- func (engine *PdfCpu) EmbedFiles(ctx context.Context, logger *slog.Logger, filePaths []string, inputPath string) error
- func (engine *PdfCpu) Encrypt(ctx context.Context, logger *slog.Logger, ...) error
- func (engine *PdfCpu) Flatten(ctx context.Context, logger *slog.Logger, inputPath string) error
- func (engine *PdfCpu) Merge(ctx context.Context, logger *slog.Logger, inputPaths []string, ...) error
- func (engine *PdfCpu) PageCount(ctx context.Context, logger *slog.Logger, inputPath string) (int, error)
- func (engine *PdfCpu) Provision(ctx *gotenberg.Context) error
- func (engine *PdfCpu) ReadBookmarks(ctx context.Context, logger *slog.Logger, inputPath string) ([]gotenberg.Bookmark, error)
- func (engine *PdfCpu) ReadMetadata(ctx context.Context, logger *slog.Logger, inputPath string) (map[string]any, error)
- func (engine *PdfCpu) Rotate(ctx context.Context, logger *slog.Logger, inputPath string, angle int, ...) error
- func (engine *PdfCpu) Split(ctx context.Context, logger *slog.Logger, mode gotenberg.SplitMode, ...) ([]string, error)
- func (engine *PdfCpu) Stamp(ctx context.Context, logger *slog.Logger, inputPath string, ...) error
- func (engine *PdfCpu) Validate() error
- func (engine *PdfCpu) Watermark(ctx context.Context, logger *slog.Logger, inputPath string, ...) error
- func (engine *PdfCpu) WriteBookmarks(ctx context.Context, logger *slog.Logger, inputPath string, ...) error
- func (engine *PdfCpu) WriteMetadata(ctx context.Context, logger *slog.Logger, metadata map[string]any, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PdfCpu ¶
type PdfCpu struct {
// contains filtered or unexported fields
}
PdfCpu abstracts the CLI tool pdfcpu and implements the gotenberg.PdfEngine interface.
func (*PdfCpu) Convert ¶
func (engine *PdfCpu) Convert(ctx context.Context, logger *slog.Logger, formats gotenberg.PdfFormats, inputPath, outputPath string) error
Convert is not available in this implementation.
func (*PdfCpu) Descriptor ¶
func (engine *PdfCpu) Descriptor() gotenberg.ModuleDescriptor
Descriptor returns a PdfCpu's module descriptor.
func (*PdfCpu) EmbedFiles ¶ added in v8.25.0
func (engine *PdfCpu) EmbedFiles(ctx context.Context, logger *slog.Logger, filePaths []string, inputPath string) error
EmbedFiles embeds files into a PDF. All files are embedded as file attachments without modifying the main PDF content.
func (*PdfCpu) Encrypt ¶ added in v8.23.1
func (engine *PdfCpu) Encrypt(ctx context.Context, logger *slog.Logger, inputPath, userPassword, ownerPassword string) error
Encrypt adds password protection to a PDF file using pdfcpu.
func (*PdfCpu) Merge ¶
func (engine *PdfCpu) Merge(ctx context.Context, logger *slog.Logger, inputPaths []string, outputPath string) error
Merge combines multiple PDFs into a single PDF.
func (*PdfCpu) PageCount ¶ added in v8.28.0
func (engine *PdfCpu) PageCount(ctx context.Context, logger *slog.Logger, inputPath string) (int, error)
PageCount is not available in this implementation.
func (*PdfCpu) ReadBookmarks ¶ added in v8.28.0
func (engine *PdfCpu) ReadBookmarks(ctx context.Context, logger *slog.Logger, inputPath string) ([]gotenberg.Bookmark, error)
ReadBookmarks reads the document outline (bookmarks) of a PDF file using pdfcpu.
func (*PdfCpu) ReadMetadata ¶ added in v8.3.0
func (engine *PdfCpu) ReadMetadata(ctx context.Context, logger *slog.Logger, inputPath string) (map[string]any, error)
ReadMetadata is not available in this implementation.
func (*PdfCpu) Rotate ¶ added in v8.28.0
func (engine *PdfCpu) Rotate(ctx context.Context, logger *slog.Logger, inputPath string, angle int, pages string) error
Rotate rotates pages of a PDF file by the given angle using pdfcpu.
func (*PdfCpu) Split ¶ added in v8.15.0
func (engine *PdfCpu) Split(ctx context.Context, logger *slog.Logger, mode gotenberg.SplitMode, inputPath, outputDirPath string) ([]string, error)
Split splits a given PDF file.
func (*PdfCpu) Stamp ¶ added in v8.28.0
func (engine *PdfCpu) 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 pdfcpu.
func (*PdfCpu) Watermark ¶ added in v8.28.0
func (engine *PdfCpu) 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 pdfcpu.