Versions in this module Expand all Collapse all v0 v0.1.1 Dec 3, 2026 v0.1.0 Dec 3, 2026 Changes in this version + var ErrInvalid = errors.New("pdf: invalid input") + var ErrUnsupported = errors.New("pdf: unsupported option") + func BlankPDF() []byte + func InlinedImage(ctx context.Context, path string, client *http.Client) (template.HTML, error) + func PageBreak() template.HTML + func PageNumber() template.HTML + func TotalPages() template.HTML + type BrowsershotDriver struct + BinPath string + ChromePath string + ConfigurationKey string + Customize func(*browsershot.Browsershot) + IncludePath string + NoSandbox bool + NodeBinary string + NodeModulesPath string + NpmBinary string + TempPath string + Timeout time.Duration + WriteOptionsToFile bool + func (BrowsershotDriver) SupportsReadiness() bool + func (d BrowsershotDriver) Generate(ctx context.Context, r Request) ([]byte, error) + func (d BrowsershotDriver) Identity() string + type Builder struct + func (b *Builder) Apply(fn func(*Builder)) *Builder + func (b *Builder) Attachment(ctx context.Context) (mail.Attachment, error) + func (b *Builder) Base64(ctx context.Context) (string, error) + func (b *Builder) Bytes(ctx context.Context) ([]byte, error) + func (b *Builder) Cache(ttl time.Duration, key ...string) *Builder + func (b *Builder) Contains(ctx context.Context, text ...string) (bool, error) + func (b *Builder) Disk(name string) *Builder + func (b *Builder) DocumentOutline() *Builder + func (b *Builder) DontCache() *Builder + func (b *Builder) Download(name string) *Builder + func (b *Builder) Driver(name string) *Builder + func (b *Builder) Encrypt(settings Encryption) *Builder + func (b *Builder) FooterHTML(html string) *Builder + func (b *Builder) FooterView(name string, data any) *Builder + func (b *Builder) Format(format Format) *Builder + func (b *Builder) HTML(html string) *Builder + func (b *Builder) HeaderHTML(html string) *Builder + func (b *Builder) HeaderView(name string, data any) *Builder + func (b *Builder) Headers(headers http.Header) *Builder + func (b *Builder) Inline(name string) *Builder + func (b *Builder) Job(ctx context.Context, path string) (any, error) + func (b *Builder) Landscape() *Builder + func (b *Builder) Margins(top, right, bottom, left float64, unit Unit) *Builder + func (b *Builder) Meta(m Metadata) *Builder + func (b *Builder) Name(name string) *Builder + func (b *Builder) Orientation(o Orientation) *Builder + func (b *Builder) PageRanges(ranges string) *Builder + func (b *Builder) PaperSize(width, height float64, unit Unit) *Builder + func (b *Builder) Portrait() *Builder + func (b *Builder) PostProcess(p PostProcessor) *Builder + func (b *Builder) RenderRequest(ctx context.Context) (Request, error) + func (b *Builder) Response(ctx context.Context) *web.Response + func (b *Builder) Save(ctx context.Context, path string) error + func (b *Builder) SaveQueued(ctx context.Context, path string, dispatch ...*queue.PendingDispatch) (queue.JobID, error) + func (b *Builder) Scale(scale float64) *Builder + func (b *Builder) SetDriver(d Driver) *Builder + func (b *Builder) Tagged() *Builder + func (b *Builder) View(name string, data any) *Builder + func (b *Builder) WaitUntilReady(expression string, timeout time.Duration) *Builder + func (b *Builder) When(condition bool, fn func(*Builder)) *Builder + func (b *Builder) WithBrowsershot(fn func(*browsershot.Browsershot)) *Builder + type Cache interface + Remember func(context.Context, string, time.Duration, func(context.Context) ([]byte, error)) ([]byte, error) + type ChromeDriver struct + Binary string + Environment []string + Flags map[string]any + NoSandbox bool + Timeout time.Duration + UserDataDir string + func (ChromeDriver) SupportsReadiness() bool + func (d ChromeDriver) Generate(ctx context.Context, r Request) ([]byte, error) + func (d ChromeDriver) Identity() string + type CloudflareDriver struct + AccountID string + Client *http.Client + Endpoint string + Token string + func (d CloudflareDriver) Generate(ctx context.Context, r Request) ([]byte, error) + func (d CloudflareDriver) Identity() string + type Config struct + AutomaticCache bool + Browsershot BrowsershotDriver + Cache Cache + CachePrefix string + CacheStore string + CacheTTL time.Duration + Chrome ChromeDriver + Cloudflare CloudflareDriver + DOMPDF DOMPDFDriver + Defaults func(*Builder) + Driver string + Drivers map[string]Driver + Encrypter Encrypter + Gotenberg GotenbergDriver + JobFactory func(GenerateJob) any + WeasyPrint WeasyPrintDriver + type DOMPDFDriver struct + Autoload string + Chroot string + FontCache string + FontDir string + PHP string + RemoteEnabled bool + Timeout time.Duration + func (d DOMPDFDriver) Generate(ctx context.Context, r Request) ([]byte, error) + func (d DOMPDFDriver) Identity() string + type DefaultEncrypter struct + func (DefaultEncrypter) Decrypt(ctx context.Context, data []byte, password string) ([]byte, error) + func (DefaultEncrypter) Encrypt(ctx context.Context, data []byte, settings Encryption) ([]byte, error) + func (DefaultEncrypter) Identity() string + type Driver interface + Generate func(context.Context, Request) ([]byte, error) + Identity func() string + type DriverFunc struct + Name string + Readiness bool + Render func(context.Context, Request) ([]byte, error) + func (d DriverFunc) Generate(ctx context.Context, r Request) ([]byte, error) + func (d DriverFunc) Identity() string + func (d DriverFunc) SupportsReadiness() bool + type Encrypter interface + Decrypt func(context.Context, []byte, string) ([]byte, error) + Encrypt func(context.Context, []byte, Encryption) ([]byte, error) + Identity func() string + type Encryption struct + OwnerPassword string + Permissions []Permission + UserPassword string + type Factory struct + func From(ctx context.Context) *Factory + func NewFactory(cfg Config) (*Factory, error) + func (f *Factory) Builder() *Builder + func (f *Factory) Decrypt(ctx context.Context, data []byte, password string) ([]byte, error) + func (f *Factory) HTML(html string) *Builder + func (f *Factory) View(name string, data any) *Builder + type FakeDriver struct + func (*FakeDriver) Identity() string + func (*FakeDriver) SupportsReadiness() bool + func (f *FakeDriver) Generate(ctx context.Context, request Request) ([]byte, error) + func (f *FakeDriver) Requests() []Request + type Format string + const A0 + const A1 + const A2 + const A3 + const A4 + const A5 + const A6 + const Ledger + const Legal + const Letter + const Tabloid + type GenerateJob struct + Disk string + Driver string + DriverIdentity string + EncrypterIdentity string + Encryption *Encryption + Metadata Metadata + Path string + Request Request + func (j GenerateJob) Handle(ctx context.Context) error + type GotenbergDriver struct + Client *http.Client + Password string + URL string + Username string + func (GotenbergDriver) SupportsReadiness() bool + func (d GotenbergDriver) Generate(ctx context.Context, r Request) ([]byte, error) + func (d GotenbergDriver) Identity() string + type HTTPError struct + StatusCode int + func (e *HTTPError) Error() string + type LaravelCache struct + Store string + func (c LaravelCache) Remember(ctx context.Context, key string, ttl time.Duration, ...) ([]byte, error) + type Margins struct + Bottom float64 + Left float64 + Right float64 + Top float64 + Unit Unit + type Metadata struct + Author string + CreationDate string + Creator string + Keywords string + Subject string + Title string + type Options struct + DocumentOutline bool + Format Format + Margins *Margins + Orientation Orientation + PageRanges string + PaperSize *PaperSize + ReadyTimeout time.Duration + Scale float64 + Tagged bool + WaitForReady string + func (o *Options) UnmarshalJSON(data []byte) error + func (o Options) MarshalJSON() ([]byte, error) + func (o Options) Validate() error + type Orientation string + const Landscape + const Portrait + type Package struct + func New(configure ...func(*Config)) *Package + func (p *Package) Register(app *laravel.Registrar) error + type PaperSize struct + Height float64 + Unit Unit + Width float64 + type Permission string + const Annotate + const Assemble + const Copy + const Extract + const FillForms + const Modify + const Print + const PrintHighResolution + type PostProcessor interface + Identity func() string + Process func(context.Context, []byte) ([]byte, error) + type ReadinessDriver interface + SupportsReadiness func() bool + type Request struct + FooterHTML string + HTML string + HeaderHTML string + Options Options + type Unit string + const Centimeter + const Inch + const Millimeter + const Pixel + const Point + type WeasyPrintDriver struct + Arguments []string + Binary string + Timeout time.Duration + func (d WeasyPrintDriver) Generate(ctx context.Context, r Request) ([]byte, error) + func (d WeasyPrintDriver) Identity() string