### CreateAnnotationDemoXRef Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Creates a PDF file with examples of annotations and actions. ```APIDOC ## CreateAnnotationDemoXRef ### Description CreateAnnotationDemoXRef creates a PDF file with examples of annotations and actions. ### Signature ```go func CreateAnnotationDemoXRef() (*model.XRefTable, error) ``` ``` -------------------------------- ### InstallFonts Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api Installs fonts from the specified files into the system. ```APIDOC ## InstallFonts ### Description Installs fonts from the given file paths. This makes the fonts available for use in PDF operations. ### Method func InstallFonts(fileNames []string) error ### Parameters - **fileNames** ([]string) - Required - A slice of paths to font files to install. ``` -------------------------------- ### Install Fonts Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Installs fonts for PDF processing. ```APIDOC ## InstallFonts ### Description Installs fonts for PDF processing. ### Method func InstallFonts(cmd *Command) ([]string, error) ``` -------------------------------- ### Get User Font Names Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/font Returns a list of all installed TrueType fonts. ```go func UserFontNames() []string ``` -------------------------------- ### ImportCertificates Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api ImportCertificates validates and installs certificate files into the pdfcpu configuration directory. It takes a slice of file paths and returns a slice of strings representing installed certificates and an error. ```APIDOC ## ImportCertificates ### Description ImportCertificates validates and installs found certificate files to pdfcpu config dir. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Function Signature ```go func ImportCertificates(inFiles []string) (ss []string, err error) ``` ``` -------------------------------- ### Get Default Configuration - Go Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns the default pdfcpu configuration. Use this for standard processing without custom settings. ```go func NewDefaultConfiguration() *Configuration ``` -------------------------------- ### ImportCertificates Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli ListCertificates returns installed certificates. ```APIDOC ## ImportCertificates ### Description Lists the installed digital certificates on the system. ### Method func ImportCertificates(cmd *Command) ([]string, error) ### Parameters This function takes a *Command object as input, which may contain parameters for filtering or specifying certificate stores. ``` -------------------------------- ### ListCertificates Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Returns a list of installed certificates. Added in v0.10.0. ```APIDOC ## ListCertificates ### Description Returns a list of installed certificates. Added in v0.10.0. ### Signature ```go func ListCertificates(cmd *Command) ([]string, error) ``` ``` -------------------------------- ### InstallFonts Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api InstallFonts installs true type fonts for embedding. It takes a slice of font file names and returns an error if the installation fails. ```APIDOC ## InstallFonts ### Description InstallFonts installs true type fonts for embedding. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Function Signature ```go func InstallFonts(fileNames []string) error ``` ``` -------------------------------- ### List Fonts Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Lists installed fonts. ```APIDOC ## ListFontsCommand ### Description Lists installed fonts. ### Signature func ListFontsCommand(conf *model.Configuration) *Command ``` -------------------------------- ### ListCertificatesCommand Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Creates a command to list installed certificates. Added in v0.10.0. ```APIDOC ## ListCertificatesCommand ### Description Creates a command to list installed certificates. Added in v0.10.0. ### Signature ```go func ListCertificatesCommand(json bool, conf *model.Configuration) *Command ``` ``` -------------------------------- ### Get All Bookmarks Function Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Retrieves all bookmark information from a PDF context recursively. ```go func Bookmarks(ctx *model.Context) ([]Bookmark, error) ``` -------------------------------- ### InstallFontsCommand Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Installs TrueType fonts for embedding into PDF documents. Added in v0.3.1. ```APIDOC ## InstallFontsCommand ### Description Installs TrueType fonts for embedding into PDF documents. Added in v0.3.1. ### Signature ```go func InstallFontsCommand(fontFiles []string, conf *model.Configuration) *Command ``` ``` -------------------------------- ### Guide Structure Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/primitives Represents horizontal and vertical lines for layout purposes, defined by their (x,y) position. ```go type Guide struct { Position [2]float64 `json:"pos"` // x,y // contains filtered or unexported fields } ``` -------------------------------- ### ListCertificatesAll Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Returns formatted information about all installed certificates, optionally in JSON format. Added in v0.10.0. ```APIDOC ## ListCertificatesAll ### Description Returns formatted information about all installed certificates, optionally in JSON format. Added in v0.10.0. ### Signature ```go func ListCertificatesAll(json bool, conf *model.Configuration) ([]string, error) ``` ``` -------------------------------- ### LoadCertificates Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Loads installed certificates from the default configuration path. This function is intended to be called only once. ```APIDOC ## LoadCertificates ### Description Loads installed certs from pdfcpu/config/certs exactly once. ### Signature ```go func LoadCertificates() error ``` ``` -------------------------------- ### InspectCertificates Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Prints the certificate details for installed certificates. Added in v0.11.0. ```APIDOC ## InspectCertificates ### Description Prints the certificate details for installed certificates. Added in v0.11.0. ### Signature ```go func InspectCertificates(cmd *Command) ([]string, error) ``` ``` -------------------------------- ### Get Display Unit String - Go Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns a string representation of the display unit setting in effect. ```go func (c *Configuration) UnitString() string ``` -------------------------------- ### Import String Method Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Returns a string representation of the Import configuration. ```go func (imp Import) String() string ``` -------------------------------- ### InstallFonts Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Installs True Type fonts into the pdfcpu pconfig directory. Added in v0.3.1. ```APIDOC ## InstallFonts ### Description Installs True Type fonts into the pdfcpu pconfig directory. Added in v0.3.1. ### Signature ```go func InstallFonts(cmd *Command) ([]string, error) ``` ``` -------------------------------- ### Get Permissions List from Integer Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Use PermissionsList to convert an integer representation of permissions into a human-readable list of permission strings. ```go func PermissionsList(p int) (list []string) ``` -------------------------------- ### Create Booklet N-Up Configuration Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api Returns an NUp configuration suitable for creating PDF booklets. Takes an integer value and a description string. ```go func PDFBookletConfig(val int, desc string, conf *model.Configuration) (*model.NUp, error) ``` -------------------------------- ### Get User Font Names Verbose Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/font Returns a list of all installed TrueType fonts, including their glyph counts. ```go func UserFontNamesVerbose() []string ``` -------------------------------- ### Initialize New Context - Go Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Initializes a new Context for PDF processing. Requires a ReadSeeker for the PDF source and a Configuration object. ```go func NewContext(rs io.ReadSeeker, conf *Configuration) (*Context, error) ``` -------------------------------- ### Get Default NUp Configuration Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns a pointer to an NUp struct with default configuration values. Use this as a starting point for customizing N-Up settings. ```go func DefaultNUpConfig() *NUp ``` -------------------------------- ### Create User Font Demo Files Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api Creates demo files for user fonts. ```APIDOC ## CreateUserFontDemoFiles ### Description Creates demo files for user fonts in a specified directory. ### Function Signature func CreateUserFontDemoFiles(dir, fn string) error ### Parameters - **dir** (string) - The directory to create the demo files in. - **fn** (string) - The base name for the demo files. ### Returns - **error** - An error if the operation fails. ``` -------------------------------- ### Name Object Methods Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types Provides methods for the Name object, including cloning, getting its PDF string representation, and retrieving its string value. ```go func (nameObject Name) Clone() Object ``` ```go func (nameObject Name) PDFString() string ``` ```go func (nameObject Name) String() string ``` ```go func (nameObject Name) Value() string ``` -------------------------------- ### Name Type Methods Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types Methods associated with the Name type, providing functionality to clone, get a PDF-formatted string, and get a general string value. ```APIDOC ## Name Type Methods ### Description Provides methods for the Name type to create copies, format for PDF output, and retrieve its string value. ### Methods - **Clone() Object**: Returns a clone of the Name object. - **PDFString() string**: Returns a string representation as found in and written to a PDF file. - **Value() string**: Returns a string value for this PDF object. ``` -------------------------------- ### Get Page Dictionary and Attributes - Go Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Retrieves a specific page dictionary along with its effective resources, mediaBox, and CropBox. Consolidating resources optimizes output. ```go func (xRefTable *XRefTable) PageDict(pageNr int, consolidateRes bool) (types.Dict, *types.IndirectRef, *InheritedPageAttrs, error) ``` -------------------------------- ### Create User Font Demo Files Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api Generates single-page PDF files for each Unicode plane covered by user fonts. Requires a directory and a filename prefix. ```go func CreateUserFontDemoFiles(dir, fn string) error ``` -------------------------------- ### Get Core Font Character Width Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/internal/corefont/metrics Use CoreFontCharWidth to get the character width for a given font name and character code in glyph space units. This function is part of the core font metrics. ```go func CoreFontCharWidth(fontName string, c int) int ``` -------------------------------- ### Create New Sound Stream Dictionary Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Constructs and returns a new sound stream dictionary, including parameters like filename, sampling rate, and an associated file specification dictionary. ```go func (xRefTable *XRefTable) NewSoundStreamDict(filename string, samplingRate int, fileSpecDict types.Dict) (*types.IndirectRef, error) ``` -------------------------------- ### Create ResizeCommand Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Use this command to create a new command for scaling selected pages. ```go func ResizeCommand(inFile, outFile string, pageSelection []string, resize *model.Resize, conf *model.Configuration) *Command ``` -------------------------------- ### Default Import Configuration Function Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Provides the default configuration settings for importing an image. ```go func DefaultImportConfig() *Import ``` -------------------------------- ### Create Grid N-Up Configuration Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api Returns an NUp configuration for arranging PDF pages in a grid layout. Takes the number of rows and columns, a description string, and a configuration object. ```go func PDFGridConfig(rows, cols int, desc string, conf *model.Configuration) (*model.NUp, error) ``` -------------------------------- ### ListFonts Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api Lists all installed fonts available to the library. ```APIDOC ## ListFonts ### Description Retrieves a list of all fonts that are currently installed and available for use. ### Method func ListFonts() ([]string, error) ``` -------------------------------- ### Create New PageResourceNames Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Initializes and returns an empty PageResourceNames map. Used to start collecting resource names for a page. ```go func NewPageResourceNames() PageResourceNames ``` -------------------------------- ### Get Duplicate Info Objects String Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns a formatted string and the count of duplicate info objects. ```go func (oc *OptimizationContext) DuplicateInfoObjectsString() (int, string) ``` -------------------------------- ### Create N-Up PDF from Image Files Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api Creates a single-page N-up PDF for one image or multiple N-up pages for a sequence of images. Requires configuration. ```go func NUpFromImage(conf *model.Configuration, imageFileNames []string, nup *model.NUp) (*model.Context, error) ``` -------------------------------- ### Create N-Up Command Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Creates a command to render PDFs or image files in n-up fashion. ```go func NUpCommand(inFiles []string, outFile string, pageSelection []string, nUp *model.NUp, conf *model.Configuration) *Command ``` -------------------------------- ### ColorSpaceString Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Gets the string representation of a color space. ```APIDOC ## ColorSpaceString ### Description Gets the string representation of a color space from a stream dictionary. ### Signature func ColorSpaceString(ctx *model.Context, sd *types.StreamDict) (string, error) ``` -------------------------------- ### Get Permissions List Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Use Permissions to retrieve a list of all set permissions for a PDF document context. ```go func Permissions(ctx *model.Context) (list []string) ``` -------------------------------- ### Create PDF Command Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Creates a command to generate a PDF file from a PDF and a JSON input. Requires input PDF, input JSON, output PDF paths, and configuration. ```go func CreateCommand(inFilePDF, inFileJSON, outFilePDF string, conf *model.Configuration) *Command ``` -------------------------------- ### FontDescriptor Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/font FontDescriptor gets the font descriptor for this font. ```APIDOC ## func FontDescriptor ### Description FontDescriptor gets the font descriptor for this font. ### Signature ```go func FontDescriptor(xRefTable *model.XRefTable, fontDict types.Dict, objNr int) (types.Dict, error) ``` ``` -------------------------------- ### CreateFormDemoXRef Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Creates a cross-reference table with an AcroForm example. ```APIDOC ## CreateFormDemoXRef ### Description CreateFormDemoXRef creates an xRefTable with an AcroForm example. ### Signature ```go func CreateFormDemoXRef() (*model.XRefTable, error) ``` ``` -------------------------------- ### Get PDF Version - Go Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns the PDF version of the file. Considers both header version and the catalog's Version entry for accuracy, especially for versions 1.4 and later. ```go func (xRefTable *XRefTable) Version() Version ``` -------------------------------- ### CreateDemoXRef Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Creates a minimal single-page PDF file for demonstration purposes. ```APIDOC ## CreateDemoXRef ### Description CreateDemoXRef creates a minimal single page PDF file for demo purposes. ### Signature ```go func CreateDemoXRef() (*model.XRefTable, error) ``` ``` -------------------------------- ### Create Booklet from Images Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api Creates a booklet layout from a list of image files. Requires configuration and N-up settings. ```go func BookletFromImages(conf *model.Configuration, imageFileNames []string, nup *model.NUp) (*model.Context, error) ``` -------------------------------- ### UserFontNames Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/font UserFontNames return a list of all installed TrueType fonts. ```APIDOC ## UserFontNames ### Description UserFontNames return a list of all installed TrueType fonts. ### Signature ```go func UserFontNames() []string ``` ``` -------------------------------- ### Get PDF Version as String - Go Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns a string representation of the PDF file's version. Provides a human-readable format for the PDF version. ```go func (xRefTable *XRefTable) VersionString() string ``` -------------------------------- ### LoadConfiguration Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api Loads the default configuration settings. ```APIDOC ## LoadConfiguration ### Description Loads and returns the default configuration object used for PDF operations. ### Method func LoadConfiguration() *model.Configuration ``` -------------------------------- ### IsUserFont Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/font IsUserFont returns true for installed TrueType fonts. ```APIDOC ## func IsUserFont ### Description IsUserFont returns true for installed TrueType fonts. ### Signature ```go func IsUserFont(fontName string) bool ``` ``` -------------------------------- ### Ensure Default Configuration Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Ensures the default PDF-CPU configuration exists at the specified path, creating it if necessary. Allows overriding existing configurations. ```go func EnsureDefaultConfigAt(path string, override bool) error ``` -------------------------------- ### Get Annotation Type Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns the enumerated type of the annotation. ```go func (ann Annotation) Type() AnnotationType ``` -------------------------------- ### Create PDF from Files Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api Renders PDF content from a JSON file into an output PDF file. Optionally appends content to an existing input PDF file. ```go func CreateFile(inFilePDF, inFileJSON, outFilePDF string, conf *model.Configuration) (err error) ``` -------------------------------- ### Get Annotation ID Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Retrieves the unique identifier for the annotation. ```go func (ann Annotation) ID() string ``` -------------------------------- ### Check Configuration Version Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Checks the configuration version and prints a warning if it is outdated. Added in v0.9.0. ```go func CheckConfigVersion(v string) ``` -------------------------------- ### Get Annotation Hash Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Calculates and returns the hash of the annotation. ```go func (ann Annotation) HashString() uint32 ``` -------------------------------- ### Create PDF from XRefTable Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api Creates a PDF file from an XRefTable structure and writes it to a specified output file. Requires the XRefTable and configuration. ```go func CreatePDFFile(xRefTable *model.XRefTable, outFile string, conf *model.Configuration) error ``` -------------------------------- ### Configuration Methods Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Methods for managing PDF-CPU configuration settings. ```APIDOC ## NewDefaultConfiguration ### Description NewDefaultConfiguration returns the default pdfcpu configuration. ### Signature ```go func NewDefaultConfiguration() *Configuration ``` ``` ```APIDOC ## NewRC4Configuration ### Description NewRC4Configuration returns a default configuration for RC4 encryption. ### Signature ```go func NewRC4Configuration(userPW, ownerPW string, keyLength int) *Configuration ``` ``` ```APIDOC ## (*Configuration) ApplyReducedFeatureSet ### Description ApplyReducedFeatureSet returns true if complex entries like annotations shall not be written. ### Signature ```go func (c *Configuration) ApplyReducedFeatureSet() bool ``` ``` ```APIDOC ## (*Configuration) EolString ### Description EolString returns a string rep for the eol in effect. ### Signature ```go func (c *Configuration) EolString() string ``` ``` ```APIDOC ## (*Configuration) PreferredCertRevocationCheckerString ### Description PreferredCertRevocationCheckerString returns a string rep for the preferred certificate revocation checker in effect. ### Signature ```go func (c *Configuration) PreferredCertRevocationCheckerString() string ``` ``` ```APIDOC ## (*Configuration) SetUnit ### Description SetUnit configures the display unit. ### Signature ```go func (c *Configuration) SetUnit(s string) ``` ``` ```APIDOC ## (*Configuration) UnitString ### Description UnitString returns a string rep for the display unit in effect. ### Signature ```go func (c *Configuration) UnitString() string ``` ``` ```APIDOC ## (*Configuration) ValidationModeString ### Description ValidationModeString returns a string rep for the validation mode in effect. ### Signature ```go func (c *Configuration) ValidationModeString() string ``` ``` -------------------------------- ### LoadConfiguration Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api LoadConfiguration locates and loads the default PDFcpu configuration, including any installed user fonts. It returns a pointer to the Configuration object. ```APIDOC ## LoadConfiguration ### Description LoadConfiguration locates and loads the default configuration and also loads installed user fonts. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Function Signature ```go func LoadConfiguration() *model.Configuration ``` ``` -------------------------------- ### CreateDemoXRef Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Creates a demo XRef table. ```APIDOC ## CreateDemoXRef ### Description Creates a demo XRef table for testing purposes. ### Signature func CreateDemoXRef() (*model.XRefTable, error) ``` -------------------------------- ### UserFontNames Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/font UserFontNames returns a list of installed user font names. ```APIDOC ## func UserFontNames ### Description UserFontNames returns a list of installed user font names. ### Signature ```go func UserFontNames() []string ``` ``` -------------------------------- ### Set Permissions Command Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Sets the permissions for a given PDF file. ```go func SetPermissions(cmd *Command) ([]string, error) ``` -------------------------------- ### Get Encryption Dictionary Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Retrieves the encryption dictionary of the PDF document. ```go func (xRefTable *XRefTable) EncryptDict() (types.Dict, error) ``` -------------------------------- ### Create New ComboBox Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/primitives Initializes a new combobox from a dictionary representation. Requires context, dictionary, default value, appearance stream, and font references. Returns the combobox, its indirect reference, and any error. ```go func NewComboBox( ctx *model.Context, d types.Dict, v string, da *string, fonts map[string]types.IndirectRef) (*ComboBox, *types.IndirectRef, error) ``` -------------------------------- ### Get SigningTime from SignatureValidationResult Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Retrieves the signing time of the signature as a string. ```go func (svr *SignatureValidationResult) SigningTime() string ``` -------------------------------- ### Create Optimize Command Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Creates a command to optimize a PDF file. ```go func OptimizeCommand(inFile, outFile string, conf *model.Configuration) *Command ``` -------------------------------- ### Get Stream Length Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Returns the stream length of a given StreamDict. ```go func StreamLength(ctx *model.Context, sd *types.StreamDict) (int64, error) ``` -------------------------------- ### Create Export Bookmarks Command Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Creates a command to export bookmarks from a PDF file to a JSON file. Requires input PDF and output JSON file paths, and configuration. ```go func ExportBookmarksCommand(inFile, outFileJSON string, conf *model.Configuration) *Command ``` -------------------------------- ### FontIndRef Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/primitives FontIndRef is used to get an indirect reference to a font by its name. ```APIDOC ## FontIndRef ### Description Gets an indirect reference to a font by its name. ### Signature ```go func FontIndRef(fName string, ctx *model.Context, fonts map[string]types.IndirectRef) (*types.IndirectRef, error) ``` ``` -------------------------------- ### Create SetPageLayoutCommand Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Use this command to create a new command for setting the document page layout. ```go func SetPageLayoutCommand(inFile, outFile, value string, conf *model.Configuration) *Command ``` -------------------------------- ### ImportBookmarksCommand Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Creates a new command to import bookmarks to a PDF file. Supports replacing existing bookmarks. ```APIDOC ## ImportBookmarksCommand ### Description Creates a new command to import bookmarks to inFile. Supports replacing existing bookmarks. ### Signature ```go func ImportBookmarksCommand(inFile, inFileJSON, outFile string, replace bool, conf *model.Configuration) *Command ``` ``` -------------------------------- ### AppendPages Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Appends pages to the document starting from a specified page number. ```APIDOC ## func (*XRefTable) AppendPages ### Description Appends pages to the document starting from a specified page number. ### Added in version 0.6.0 ### Signature ```go func (xRefTable *XRefTable) AppendPages(rootPageIndRef *types.IndirectRef, fromPageNr int, ctx *Context) (int, error) ``` ### Parameters - **rootPageIndRef** (*types.IndirectRef): An indirect reference to the root page. - **fromPageNr** (int): The page number to start appending from. - **ctx** (*Context): The context for the operation. ``` -------------------------------- ### IsStringUTF16BE Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types Checks if a string starts with a UTF16BE byte order mark. ```APIDOC ## IsStringUTF16BE `func IsStringUTF16BE(s string) bool` Checks if the given string `s` starts with a UTF16BE byte order mark (BOM). ``` -------------------------------- ### Configuration and Parsing Functions Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Functions for configuring N-up layouts, parsing various configuration strings, and handling PDF objects. ```APIDOC ## PDFBookletConfig ### Description Configures booklet settings for N-up layouts. ### Signature func PDFBookletConfig(val int, desc string, conf *model.Configuration) (*model.NUp, error) ## PDFGridConfig ### Description Configures grid settings for N-up layouts. ### Signature func PDFGridConfig(rows, cols int, desc string, conf *model.Configuration) (*model.NUp, error) ## PDFNUpConfig ### Description Configures general N-up settings. ### Signature func PDFNUpConfig(val int, desc string, conf *model.Configuration) (*model.NUp, error) ## ParseCutConfig ### Description Parses cut configuration from a string. ### Signature func ParseCutConfig(s string, u types.DisplayUnit) (*model.Cut, error) ## ParseCutConfigForN ### Description Parses cut configuration for a specific N value. ### Signature func ParseCutConfigForN(n int, s string, u types.DisplayUnit) (*model.Cut, error) ## ParseCutConfigForPoster ### Description Parses cut configuration for poster layouts. ### Signature func ParseCutConfigForPoster(s string, u types.DisplayUnit) (*model.Cut, error) ## ParseNUpDetails ### Description Parses N-up layout details from a string. ### Signature func ParseNUpDetails(s string, nup *model.NUp) error ## ParseNUpGridDefinition ### Description Parses N-up grid definition from rows and columns. ### Signature func ParseNUpGridDefinition(rows, cols int, nUp *model.NUp) error ## ParseNUpValue ### Description Parses an N-up value. ### Signature func ParseNUpValue(n int, nUp *model.NUp) error ## ParseObjectWithContext ### Description Parses a PDF object with context. ### Signature func ParseObjectWithContext(c context.Context, ctx *model.Context, offset int64, objNr, genNr int) (types.Object, error) ## ParsePageDim ### Description Parses page dimensions from a string. ### Signature func ParsePageDim(v string, u types.DisplayUnit) (*types.Dim, string, error) ## ParseResizeConfig ### Description Parses resize configuration from a string. ### Signature func ParseResizeConfig(s string, u types.DisplayUnit) (*model.Resize, error) ## ParseZoomConfig ### Description Parses zoom configuration from a string. ### Signature func ParseZoomConfig(s string, u types.DisplayUnit) (*model.Zoom, error) ``` -------------------------------- ### CreateCheatSheetsUserFonts Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api Creates single-page PDF cheat sheets for installed user fonts. ```APIDOC ## CreateCheatSheetsUserFonts ### Description CreateCheatSheetsUserFonts creates single page PDF cheat sheets for installed user fonts. ### Signature ```go func CreateCheatSheetsUserFonts(fontNames []string) error ``` ``` -------------------------------- ### Create SetViewerPreferencesCommand Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Use this command to create a new command for setting the viewer preferences. ```go func SetViewerPreferencesCommand(inFilePDF, inFileJSON, outFilePDF, stringJSON string, conf *model.Configuration) *Command ``` -------------------------------- ### NewAESConfiguration Constructor Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Creates a new Configuration object with default settings for AES encryption. It requires user and owner passwords, and the desired key length. ```go func NewAESConfiguration(userPW, ownerPW string, keyLength int) *Configuration ``` -------------------------------- ### SupportedFont Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/font SupportedFont returns true for core fonts or user installed fonts. ```APIDOC ## SupportedFont ### Description SupportedFont returns true for core fonts or user installed fonts. ### Signature ```go func SupportedFont(fontName string) bool ``` ``` -------------------------------- ### Create New PDF Dictionary Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types Creates and returns a new, empty PDF Dictionary object. ```go func NewDict() Dict ``` -------------------------------- ### UserFontNamesVerbose Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/font UserFontNamesVerbose returns a verbose list of installed user font names. ```APIDOC ## func UserFontNamesVerbose ### Description UserFontNamesVerbose returns a verbose list of installed user font names. ### Signature ```go func UserFontNamesVerbose() []string ``` ``` -------------------------------- ### Create Name Array Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types Creates a PDF array containing Name entries. Requires a list of strings as input. ```go func NewNameArray(sVars ...string) Array ``` -------------------------------- ### Get Destination Name Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Retrieves the name associated with a PDF destination object. ```go func (xRefTable *XRefTable) DestName(obj types.Object) (string, error) ``` -------------------------------- ### Get Permissions from SignatureDetails Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Retrieves the permission level associated with the signature details. ```go func (sd *SignatureDetails) Permissions() int ``` -------------------------------- ### Create Encrypt Command Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Creates a command to encrypt a PDF file. Requires input and output file paths and configuration. ```go func EncryptCommand(inFile, outFile string, conf *model.Configuration) *Command ``` -------------------------------- ### Get Annotation Contents as String Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns the annotation's content as a string. ```go func (ann Annotation) ContentString() string ``` -------------------------------- ### Write PDF Context Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Generates a PDF file from the cross-reference table contained within the Context. ```go func WriteContext(ctx *model.Context) (err error) ``` -------------------------------- ### Get String Representation of Array Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types Returns a string representation of the PDF Array. ```go func (a Array) String() string ``` -------------------------------- ### Create New Page Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Factory function to create a new Page object with specified media and crop boxes. ```go func NewPage(mediaBox, cropBox *types.Rectangle) Page ``` -------------------------------- ### Create N-Up Configuration Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Use PDFNUpConfig to create an N-Up configuration for arranging multiple PDF pages onto a single sheet. ```go func PDFNUpConfig(val int, desc string, conf *model.Configuration) (*model.NUp, error) ``` -------------------------------- ### Create RC4 Encryption Configuration - Go Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Creates a default configuration for RC4 encryption. Requires user and owner passwords, and key length. ```go func NewRC4Configuration(userPW, ownerPW string, keyLength int) *Configuration ``` -------------------------------- ### Process Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Executes a pdfcpu command. ```APIDOC ## Process ### Description Process executes a pdfcpu command. ### Signature ```go func Process(cmd *Command) (out []string, err error) ``` ``` -------------------------------- ### UserFontNamesVerbose Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/font UserFontNamesVerbose return a list of all installed TrueType fonts including glyph count. ```APIDOC ## UserFontNamesVerbose ### Description UserFontNamesVerbose return a list of all installed TrueType fonts including glyph count. ### Signature ```go func UserFontNamesVerbose() []string ``` ``` -------------------------------- ### Get Non-Referenced Objects String Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns a formatted string and the count of non-referenced objects. ```go func (oc *OptimizationContext) NonReferencedObjsString() (int, string) ``` -------------------------------- ### Get Annotation Type as String Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns a string representation of the annotation's type. ```go func (ann Annotation) TypeString() string ``` -------------------------------- ### SimpleColor Constructors Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/color Functions to create SimpleColor instances from different input formats. ```APIDOC ## func NewSimpleColor ### Description NewSimpleColor returns a SimpleColor for rgb in the form 0x00RRGGBB ### Signature ```go func NewSimpleColor(rgb uint32) SimpleColor ``` ## func NewSimpleColorForArray ### Description NewSimpleColorForArray returns a SimpleColor for an r,g,b array. ### Signature ```go func NewSimpleColorForArray(arr types.Array) SimpleColor ``` ## func NewSimpleColorForHexCode ### Description NewSimpleColorForHexCode returns a SimpleColor for a #FFFFFF type hexadecimal rgb color representation. ### Signature ```go func NewSimpleColorForHexCode(hexCol string) (SimpleColor, error) ``` ``` -------------------------------- ### Get Images Function Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Retrieves all embedded images from specified pages of a PDF context. ```go func Images(ctx *model.Context, selectedPages types.IntSet) ([]map[int]model.Image, *ImageListMaxLengths, error) ``` -------------------------------- ### Get Boolean Value Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types Returns the underlying boolean value of a PDF Boolean object. ```go func (boolean Boolean) Value() bool ``` -------------------------------- ### Get String Representation of Boolean Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types Returns a string representation of the PDF Boolean object. ```go func (boolean Boolean) String() string ``` -------------------------------- ### Get Annotation Rectangle as String Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns a string representation of the annotation's bounding rectangle. ```go func (ann Annotation) RectString() string ``` -------------------------------- ### Get Annotation Custom Type as String Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns the annotation's custom type as a string. ```go func (ann Annotation) CustomTypeString() string ``` -------------------------------- ### Create Command Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Creates a PDF file from a JSON definition. ```APIDOC ## CreateCommand ### Description Creates a PDF file from a JSON definition. ### Signature func CreateCommand(inFilePDF, inFileJSON, outFilePDF string, conf *model.Configuration) *Command ``` -------------------------------- ### Get TTFLight Glyph IDs Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/font Returns a slice of glyph IDs from the TTFLight font structure. ```go func (fd TTFLight) Gids() []int ``` -------------------------------- ### Get First ID Element Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Retrieves the first element of the PDF document's ID array. ```go func (xRefTable *XRefTable) IDFirstElement() (id []byte, err error) ``` -------------------------------- ### Get Default Watermark Configuration Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns a pointer to a Watermark struct initialized with default configuration values. ```go func DefaultWatermarkConfig() *Watermark ``` -------------------------------- ### Create SplitCommand Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Use this command to create a new command for splitting a file by span or along bookmarks. ```go func SplitCommand(inFile, dirNameOut string, span int, conf *model.Configuration) *Command ``` -------------------------------- ### Get Duplicate Image Objects String Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns a formatted string and the count of duplicate image objects. ```go func (oc *OptimizationContext) DuplicateImageObjectsString() (int, string) ``` -------------------------------- ### Create Booklet Command Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Creates a command to render PDFs or image files in booklet fashion. Supports multiple input files, page selection, booklet layout configuration, and general configuration. ```go func BookletCommand(inFiles []string, outFile string, pageSelection []string, nup *model.NUp, conf *model.Configuration) *Command ``` -------------------------------- ### Get Duplicate Font Objects String Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns a formatted string and the count of duplicate font objects. ```go func (oc *OptimizationContext) DuplicateFontObjectsString() (int, string) ``` -------------------------------- ### CreatePDFFile Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api Creates a PDF file from an xRefTable. ```APIDOC ## CreatePDFFile ### Description CreatePDFFile creates a PDF file for an xRefTable and writes it to outFile. ### Signature ```go func CreatePDFFile(xRefTable *model.XRefTable, outFile string, conf *model.Configuration) error ``` ``` -------------------------------- ### Get Validation Mode String - Go Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns a string representation of the validation mode setting in effect. ```go func (c *Configuration) ValidationModeString() string ``` -------------------------------- ### CreateCommand Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Creates a new command to create a PDF file. ```APIDOC ## CreateCommand ### Description Creates a new command to create a PDF file. ### Signature ```go func CreateCommand(inFilePDF, inFileJSON, outFilePDF string, conf *model.Configuration) *Command ``` ``` -------------------------------- ### Create a New PDF File by Merging Input Files Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api Merges a list of input PDF files and writes the combined result to a new output PDF file. Supports divider pages and configuration. ```go func MergeCreateFile(inFiles []string, outFile string, dividerPage bool, conf *model.Configuration) (err error) ``` -------------------------------- ### Get EOL String Representation - Go Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns a string representation of the end-of-line (EOL) setting in effect. ```go func (c *Configuration) EolString() string ``` -------------------------------- ### AddPages Function Signature Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Copies pages and their resources from a source context to a destination context. Optionally uses a page cache. ```go func AddPages(ctxSrc, ctxDest *model.Context, pageNrs []int, usePgCache bool) error ``` -------------------------------- ### Create Crop Command Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Creates a command to apply a cropBox to selected pages of a PDF. Requires input and output file paths, page selection, crop box dimensions, and configuration. ```go func CropCommand(inFile, outFile string, pageSelection []string, box *model.Box, conf *model.Configuration) *Command ``` -------------------------------- ### Get Font Language Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/font Extracts the language associated with a font dictionary. Useful for language-specific text processing. ```go func Lang(xRefTable *model.XRefTable, fontDict types.Dict) (string, error) ``` -------------------------------- ### Get CIDWidths Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/font Returns the W value for a CIDFontDict, representing glyph widths. Used in conjunction with CIDFontDict. ```go func CIDWidths(xRefTable *model.XRefTable, ttf font.TTFLight, fontName string, subFont bool, indRef *types.IndirectRef) (*types.IndirectRef, error) ``` -------------------------------- ### Create Dump Command Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Creates a command to dump objects from a PDF file to standard output. Requires the input PDF file path, a list of object values, and configuration. ```go func DumpCommand(inFilePDF string, vals []int, conf *model.Configuration) *Command ``` -------------------------------- ### Check for UTF-16BE BOM Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types Checks if a string starts with the Big Endian byte order mark for UTF-16. ```go func IsStringUTF16BE(s string) bool ``` -------------------------------- ### Get PaperHandling from String Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Converts a string representation to a PaperHandling enum value. Useful for parsing printing preferences. ```go func PaperHandlingFor(s string) *PaperHandling ``` -------------------------------- ### Parse Import Details Function Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Parses a string representation of import details into an Import configuration structure. ```go func ParseImportDetails(s string, u types.DisplayUnit) (*Import, error) ``` -------------------------------- ### Get PageMode from String Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Converts a string representation to a PageMode enum value. Useful for parsing viewer preferences. ```go func PageModeFor(s string) *PageMode ``` -------------------------------- ### Get PageLayout from String Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Converts a string representation to a PageLayout enum value. Useful for parsing display preferences. ```go func PageLayoutFor(s string) *PageLayout ``` -------------------------------- ### Create TrimCommand Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/cli Use this command to create a new command for trimming the pages of a file. ```go func TrimCommand(inFile, outFile string, pageSelection []string, conf *model.Configuration) *Command ``` -------------------------------- ### CreateContext Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Creates a PDF context from an XRef table and configuration. ```APIDOC ## CreateContext ### Description Creates a PDF context from an existing XRef table and a configuration object. ### Signature func CreateContext(xRefTable *model.XRefTable, conf *model.Configuration) *model.Context ``` -------------------------------- ### Get MediaBox from PageBoundaries Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns the effective mediabox for a given PageBoundaries. MediaBox defines the physical dimensions of the page. ```go func (pb PageBoundaries) MediaBox() *types.Rectangle ``` -------------------------------- ### NewPoint Constructor Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types Creates and returns a new Point with the specified X and Y coordinates. ```go func NewPoint(x, y float64) Point ``` -------------------------------- ### Get BleedBox from PageBoundaries Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns the effective bleedbox for a given PageBoundaries. BleedBox indicates the area to be clipped after printing. ```go func (pb PageBoundaries) BleedBox() *types.Rectangle ``` -------------------------------- ### Get ArtBox from PageBoundaries Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns the effective artbox for a given PageBoundaries. ArtBox defines the extent of the page content. ```go func (pb PageBoundaries) ArtBox() *types.Rectangle ``` -------------------------------- ### BookletFromImages Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api Creates a booklet from a list of image file names. Requires a configuration and N-up settings. ```APIDOC ## BookletFromImages ### Description Creates a booklet from images. ### Signature ```go func BookletFromImages(conf *model.Configuration, imageFileNames []string, nup *model.NUp) (*model.Context, error) ``` ``` -------------------------------- ### Get Annotation Appearance Stream Object Number Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Retrieves the object number of the annotation's appearance stream. ```go func (ann Annotation) APObjNrInt() int ``` -------------------------------- ### ImageBox RenderForFill Method Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/primitives Renders an ImageBox during the form filling process. ```go func (ib *ImageBox) RenderForFill(pdf *PDF, p *model.Page, pageNr int, imageMap model.ImageMap) error ``` -------------------------------- ### Get Page Number from Destination Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Use PageNrFromDestination to retrieve the page number associated with a PDF destination object. ```go func PageNrFromDestination(ctx *model.Context, dest types.Object) (int, error) ``` -------------------------------- ### List Viewer Preferences Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Generates a string representation of the viewer preferences, suitable for command-line output. Added in v0.6.0. ```go func (vp ViewerPreferences) List() []string ``` -------------------------------- ### Get 'Index' Array Entry from Dictionary Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types Retrieves a pointer to an Array object associated with the key 'Index' from the dictionary. ```go func (d Dict) Index() Array ``` -------------------------------- ### Get 'First' Integer Entry from Dictionary Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types Retrieves a pointer to an integer value associated with the key 'First' from the dictionary. ```go func (d Dict) First() *int ``` -------------------------------- ### Render Image Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu Returns a reader for a decoded image stream, optionally as a thumbnail. ```go func RenderImage(xRefTable *model.XRefTable, sd *types.StreamDict, thumb bool, resourceName string, objNr int) (io.Reader, string, error) ``` -------------------------------- ### Get PageBoundary from String Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Converts a string representation to a PageBoundary enum value. Useful for parsing configuration or user input. ```go func PageBoundaryFor(s string) *PageBoundary ``` -------------------------------- ### Create Image Stream Dictionary Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Creates an image stream dictionary from a reader. Returns the stream dictionary, width, height, and an error. ```go func CreateImageStreamDict(xRefTable *XRefTable, r io.Reader) (*types.StreamDict, int, int, error) ``` -------------------------------- ### Get TrimBox from PageBoundaries Source: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model Returns the effective trimbox for a given PageBoundaries. TrimBox defines the intended dimensions of the finished page. ```go func (pb PageBoundaries) TrimBox() *types.Rectangle ```