Versions in this module Expand all Collapse all v0 v0.4.2 Mar 15, 2023 v0.4.0 Mar 15, 2023 Changes in this version + const ObjectStreamMaxObjects + var ErrUnknownEncryption = errors.New("pdfcpu: PDF 2.0 encryption not supported") + var ErrUnsupported16BPC = errors.New("unsupported 16 bits per component") + var ErrWrongPassword = errors.New("pdfcpu: please provide the correct password") + func AddAnnotation(ctx *model.Context, pageDictIndRef *types.IndirectRef, pageDict types.Dict, ...) (bool, error) + func AddAnnotations(ctx *model.Context, selectedPages types.IntSet, ar model.AnnotationRenderer, ...) (bool, error) + func AddAnnotationsMap(ctx *model.Context, m map[int][]model.AnnotationRenderer, incr bool) (bool, error) + func AddBookmarks(ctx *model.Context, bms []Bookmark) error + func AddPageTreeWithSamplePage(xRefTable *model.XRefTable, rootDict types.Dict, p model.Page) error + func AddPages(ctxSrc, ctxDest *model.Context, pageNrs []int, usePgCache bool) error + func AddWatermarks(ctx *model.Context, selectedPages types.IntSet, wm *model.Watermark) error + func AddWatermarksMap(ctx *model.Context, m map[int]*model.Watermark) error + func AddWatermarksSliceMap(ctx *model.Context, m map[int][]*model.Watermark) error + func Annotation(xRefTable *model.XRefTable, d types.Dict) (model.AnnotationRenderer, error) + func AppendStatsFile(ctx *model.Context) error + func BookletFromImages(ctx *model.Context, fileNames []string, nup *model.NUp, pagesDict types.Dict, ...) error + func BookletFromPDF(ctx *model.Context, selectedPages types.IntSet, nup *model.NUp) error + func CachedAnnotationObjNrs(ctx *model.Context) ([]int, error) + func CollectPages(ctx *model.Context, collectedPages []int) (*model.Context, error) + func ColorSpaceComponents(xRefTable *model.XRefTable, sd *types.StreamDict) (int, error) + func ColorSpaceString(ctx *model.Context, sd *types.StreamDict) (string, error) + func CreateAcroFormDemoXRef() (*model.XRefTable, error) + func CreateAnnotationDemoXRef() (*model.XRefTable, error) + func CreateContext(xRefTable *model.XRefTable, conf *model.Configuration) *model.Context + func CreateContextWithXRefTable(conf *model.Configuration, pageDim *types.Dim) (*model.Context, error) + func CreateDemoXRef() (*model.XRefTable, error) + func CreateResourceDictInheritanceDemoXRef() (*model.XRefTable, error) + func CreateTestPageContent(p model.Page) + func CreateXRefTableWithRootDict() (*model.XRefTable, error) + func DefaultBookletConfig() *model.NUp + func DetectPageTreeWatermarks(ctx *model.Context) error + func DetectWatermarks(ctx *model.Context) error + func ExtractImage(ctx *model.Context, sd *types.StreamDict, thumb bool, resourceId string, ...) (*model.Image, error) + func ExtractPage(ctx *model.Context, pageNr int) (*model.Context, error) + func ExtractPageContent(ctx *model.Context, pageNr int) (io.Reader, error) + func ExtractPageImages(ctx *model.Context, pageNr int, stub bool) (map[int]model.Image, error) + func ExtractPages(ctx *model.Context, pageNrs []int, usePgCache bool) (*model.Context, error) + func FontObjNrs(ctx *model.Context, pageNr int) []int + func ImageBookletConfig(val int, desc string) (*model.NUp, error) + func ImageGridConfig(rows, cols int, desc string) (*model.NUp, error) + func ImageNUpConfig(val int, desc string) (*model.NUp, error) + func ImageObjNrs(ctx *model.Context, pageNr int) []int + func InfoDigest(ctx *model.Context, selectedPages types.IntSet) ([]string, error) + func KeywordsAdd(xRefTable *model.XRefTable, keywords []string) error + func KeywordsList(xRefTable *model.XRefTable) ([]string, error) + func KeywordsRemove(xRefTable *model.XRefTable, keywords []string) (bool, error) + func ListAnnotations(ctx *model.Context, selectedPages types.IntSet) (int, []string, error) + func ListImages(ctx *model.Context, selectedPages types.IntSet) ([]string, error) + func MergeXRefTables(ctxSource, ctxDest *model.Context) (err error) + func NUpFromMultipleImages(ctx *model.Context, fileNames []string, nup *model.NUp, pagesDict types.Dict, ...) error + func NUpFromOneImage(ctx *model.Context, fileName string, nup *model.NUp, pagesDict types.Dict, ...) error + func NUpFromPDF(ctx *model.Context, selectedPages types.IntSet, nup *model.NUp) error + func NewNUpPageForImage(xRefTable *model.XRefTable, fileName string, parentIndRef *types.IndirectRef, ...) (*types.IndirectRef, error) + func NewPageForImage(xRefTable *model.XRefTable, r io.Reader, parentIndRef *types.IndirectRef, ...) (*types.IndirectRef, error) + func OptimizeXRefTable(ctx *model.Context) error + func PDFBookletConfig(val int, desc string) (*model.NUp, error) + func PDFGridConfig(rows, cols int, desc string) (*model.NUp, error) + func PDFNUpConfig(val int, desc string) (*model.NUp, error) + func PageObjFromDestinationArray(ctx *model.Context, dest types.Object) (*types.IndirectRef, error) + func ParseImageWatermarkDetails(fileName, desc string, onTop bool, u types.DisplayUnit) (*model.Watermark, error) + func ParseNUpDetails(s string, nup *model.NUp) error + func ParseNUpGridDefinition(rows, cols int, nUp *model.NUp) error + func ParseNUpValue(n int, nUp *model.NUp) error + func ParseObject(ctx *model.Context, offset int64, objNr, genNr int) (types.Object, error) + func ParsePDFWatermarkDetails(fileName, desc string, onTop bool, u types.DisplayUnit) (*model.Watermark, error) + func ParseResizeConfig(s string, u types.DisplayUnit) (*model.Resize, error) + func ParseTextWatermarkDetails(text, desc string, onTop bool, u types.DisplayUnit) (*model.Watermark, error) + func Permissions(ctx *model.Context) (list []string) + func PropertiesAdd(ctx *model.Context, properties map[string]string) error + func PropertiesList(ctx *model.Context) ([]string, error) + func PropertiesRemove(ctx *model.Context, properties []string) (bool, error) + func Read(rs io.ReadSeeker, conf *model.Configuration) (*model.Context, error) + func ReadFile(inFile string, conf *model.Configuration) (*model.Context, error) + func RemoveAnnotations(ctx *model.Context, selectedPages types.IntSet, idsAndTypes []string, ...) (bool, error) + func RemoveAnnotationsFromPageDict(ctx *model.Context, annotTypes []model.AnnotationType, ids []string, ...) (bool, error) + func RemoveWatermarks(ctx *model.Context, selectedPages types.IntSet) error + func RenderImage(xRefTable *model.XRefTable, sd *types.StreamDict, thumb bool, ...) (io.Reader, string, error) + func Resize(ctx *model.Context, selectedPages types.IntSet, res *model.Resize) error + func RotatePages(ctx *model.Context, selectedPages types.IntSet, rotation int) error + func StreamLength(ctx *model.Context, sd *types.StreamDict) (int64, error) + func Write(ctx *model.Context) (err error) + func WriteImage(xRefTable *model.XRefTable, fileName string, sd *types.StreamDict, thumb bool, ...) (string, error) + func WriteImageToDisk(outDir, fileName string) func(model.Image, bool, int) error + func WriteIncrement(ctx *model.Context) error + func WriteReader(path string, r io.Reader) error + type Bookmark struct + Bold bool + Children []Bookmark + Color *color.SimpleColor + Italic bool + PageFrom int + PageThru int + Parent *Bookmark + Title string + func BookmarksForOutline(ctx *model.Context) ([]Bookmark, error) + func BookmarksForOutlineItem(ctx *model.Context, item *types.IndirectRef, parent *Bookmark) ([]Bookmark, error) + func (bm Bookmark) Style() int + type Font struct + Name string + Type string + func ExtractFont(ctx *model.Context, fontObject model.FontObject, objNr int) (*Font, error) + func ExtractFormFonts(ctx *model.Context) ([]Font, error) + func ExtractPageFonts(ctx *model.Context, pageNr int) ([]Font, error) + type Import struct + BgColor *color.SimpleColor + DPI int + Dx int + Dy int + Gray bool + InpUnit types.DisplayUnit + PageDim *types.Dim + PageSize string + Pos types.Anchor + Scale float64 + ScaleAbs bool + Sepia bool + UserDim bool + func DefaultImportConfig() *Import + func ParseImportDetails(s string, u types.DisplayUnit) (*Import, error) + func (imp Import) String() string + type Metadata struct + ObjNr int + ParentObjNr int + ParentType string + func ExtractMetadata(ctx *model.Context) ([]Metadata, error) + type PDFImage struct