pdf

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 8 Imported by: 0

README

pdf — PDF password protection

import "github.com/downsized-devs/sdk-go/pdf"

Stability: Beta — single feature, minimal tests. See STABILITY.md.

Encrypts an existing PDF with AES-256 password protection using pdfcpu.

Features

  • SetPasswordFile(inPath, outPath, ownerPwd, userPwd) — write a password-protected copy.

Installation

go get github.com/downsized-devs/sdk-go/pdf

Quick Start

p := pdf.Init(log)
err := p.SetPasswordFile(ctx, "/tmp/in.pdf", "/tmp/out.pdf", "ownerPwd", "userPwd")

API Reference

Symbol Signature
Init func Init(log logger.Interface) PdfInterface
PdfInterface.SetPasswordFile (ctx, in, out, ownerPwd, userPwd string) error

Dependencies

  • Internal: logger
  • External: github.com/pdfcpu/pdfcpu/pkg/api, .../pdfcpu/model

Testing

go test ./pdf/...

One test file with basic coverage.

Contributing

See CONTRIBUTING.md. Add tests as part of any non-trivial change — Beta classification will hold until coverage improves.

  • files — extension validation for input paths.
  • security — for non-PDF crypto needs.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PdfInterface

type PdfInterface interface {
	SetPasswordFile(ctx context.Context, password string, data []byte) ([]byte, error)
}

func Init

func Init(log logger.Interface) PdfInterface

Jump to

Keyboard shortcuts

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