pdfengines

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package pdfengines provides a client for the Gotenberg PDF Engines service. It offers a convenient API for converting PDFs to PDF/A & PDF/UA, reading/writing metadata, merging, splitting, and flattening PDFs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PDFEngines

type PDFEngines struct {
	*gotenberg.Gotenberg
}

PDFEngines represents a Gotenberg conversion request builder. It wraps the underlying multipart request and provides PDF Engines-specific methods.

func NewPDFEngines

func NewPDFEngines(client *httpclient.Client) *PDFEngines

func (*PDFEngines) Bool

func (r *PDFEngines) Bool(fieldName string, value bool) *PDFEngines

Bool adds a boolean form parameter to the request.

func (*PDFEngines) Convert

func (r *PDFEngines) Convert(ctx context.Context) *PDFEngines

Convert creates a request to convert PDFs to PDF/A & PDF/UA.

func (*PDFEngines) DownloadFrom

func (r *PDFEngines) DownloadFrom(url string, headers map[string]string) *PDFEngines

DownloadFrom sets the downloadFrom parameter for downloading files from URLs. The data should be a slice of DownloadItem representing the download configuration.

func (*PDFEngines) File

func (r *PDFEngines) File(filename string, content io.Reader) *PDFEngines

File adds a file to the request.

func (*PDFEngines) Flatten

func (r *PDFEngines) Flatten(ctx context.Context) *PDFEngines

Flatten creates a request to flatten PDFs.

func (*PDFEngines) FlattenPDF

func (r *PDFEngines) FlattenPDF(flatten bool) *PDFEngines

Flatten sets the flatten flag.

func (*PDFEngines) Header

func (r *PDFEngines) Header(key, value string) *PDFEngines

Header adds a header to the request.

func (*PDFEngines) Merge

func (r *PDFEngines) Merge(ctx context.Context) *PDFEngines

Merge creates a request to merge PDFs.

func (*PDFEngines) Metadata

func (r *PDFEngines) Metadata(key, value string) *PDFEngines

Metadata sets the metadata for the PDF.

func (*PDFEngines) MetadataRead

func (r *PDFEngines) MetadataRead(ctx context.Context) *PDFEngines

MetadataRead creates a request to read metadata from PDFs.

func (*PDFEngines) MetadataWrite

func (r *PDFEngines) MetadataWrite(ctx context.Context) *PDFEngines

MetadataWrite creates a request to write metadata to PDFs.

func (*PDFEngines) OutputFilename

func (r *PDFEngines) OutputFilename(filename string) *PDFEngines

OutputFilename sets the output filename.

func (*PDFEngines) PDFA

func (r *PDFEngines) PDFA(pdfa string) *PDFEngines

PDFA converts to PDF/A format.

func (*PDFEngines) PDFUA

func (r *PDFEngines) PDFUA(pdfua bool) *PDFEngines

PDFUA enables PDF for Universal Access.

func (*PDFEngines) Param

func (r *PDFEngines) Param(key, value string) *PDFEngines

Param adds a form parameter to the request.

func (*PDFEngines) Send

func (r *PDFEngines) Send() (*gotenberg.Response, error)

Send executes the request and returns the response. Returns an error if the request fails.

func (*PDFEngines) Split

func (r *PDFEngines) Split(ctx context.Context) *PDFEngines

Split creates a request to split PDFs.

func (*PDFEngines) SplitMode

func (r *PDFEngines) SplitMode(mode string) *PDFEngines

SplitMode sets the split mode.

func (*PDFEngines) SplitSpan

func (r *PDFEngines) SplitSpan(span string) *PDFEngines

SplitSpan sets the split span.

func (*PDFEngines) SplitUnify

func (r *PDFEngines) SplitUnify(unify bool) *PDFEngines

SplitUnify specifies whether to unify split pages.

func (*PDFEngines) Timeout added in v1.8.2

func (r *PDFEngines) Timeout(duration time.Duration) *PDFEngines

Timeout sets a timeout for the request.

func (*PDFEngines) Trace

func (r *PDFEngines) Trace(trace string) *PDFEngines

Trace sets the request trace identifier for debugging and monitoring. If not set, Gotenberg will assign a unique UUID trace.

func (*PDFEngines) WebhookErrorURL

func (r *PDFEngines) WebhookErrorURL(url, method string) *PDFEngines

WebhookErrorURL sets the webhook URL and HTTP method for failed operations.

func (*PDFEngines) WebhookHeader

func (r *PDFEngines) WebhookHeader(key, value string) *PDFEngines

WebhookHeader adds a custom header to be sent with webhook requests. Multiple headers can be added by calling this method multiple times.

func (*PDFEngines) WebhookURL

func (r *PDFEngines) WebhookURL(url, method string) *PDFEngines

WebhookURL sets the webhook URL and HTTP method for successful operations.

Jump to

Keyboard shortcuts

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