Documentation ¶
Overview ¶
Package cli provides pdfcpu command line processing.
Index ¶
- func AddAttachments(cmd *Command) ([]string, error)
- func AddBoxes(cmd *Command) ([]string, error)
- func AddKeywords(cmd *Command) ([]string, error)
- func AddProperties(cmd *Command) ([]string, error)
- func AddWatermarks(cmd *Command) ([]string, error)
- func Booklet(cmd *Command) ([]string, error)
- func ChangeOwnerPassword(cmd *Command) ([]string, error)
- func ChangeUserPassword(cmd *Command) ([]string, error)
- func Collect(cmd *Command) ([]string, error)
- func Create(cmd *Command) ([]string, error)
- func CreateCheatSheetsFonts(cmd *Command) ([]string, error)
- func Crop(cmd *Command) ([]string, error)
- func Decrypt(cmd *Command) ([]string, error)
- func Encrypt(cmd *Command) ([]string, error)
- func ExtractAttachments(cmd *Command) ([]string, error)
- func ExtractContent(cmd *Command) ([]string, error)
- func ExtractFonts(cmd *Command) ([]string, error)
- func ExtractImages(cmd *Command) ([]string, error)
- func ExtractMetadata(cmd *Command) ([]string, error)
- func ExtractPages(cmd *Command) ([]string, error)
- func ImportImages(cmd *Command) ([]string, error)
- func Info(cmd *Command) ([]string, error)
- func InsertPages(cmd *Command) ([]string, error)
- func InstallFonts(cmd *Command) ([]string, error)
- func ListAnnotations(cmd *Command) ([]string, error)
- func ListAttachments(cmd *Command) ([]string, error)
- func ListBoxes(cmd *Command) ([]string, error)
- func ListFonts(cmd *Command) ([]string, error)
- func ListImages(cmd *Command) ([]string, error)
- func ListKeywords(cmd *Command) ([]string, error)
- func ListPermissions(cmd *Command) ([]string, error)
- func ListProperties(cmd *Command) ([]string, error)
- func MergeAppend(cmd *Command) ([]string, error)
- func MergeCreate(cmd *Command) ([]string, error)
- func NUp(cmd *Command) ([]string, error)
- func Optimize(cmd *Command) ([]string, error)
- func Process(cmd *Command) (out []string, err error)
- func RemoveAnnotations(cmd *Command) ([]string, error)
- func RemoveAttachments(cmd *Command) ([]string, error)
- func RemoveBoxes(cmd *Command) ([]string, error)
- func RemoveKeywords(cmd *Command) ([]string, error)
- func RemovePages(cmd *Command) ([]string, error)
- func RemoveProperties(cmd *Command) ([]string, error)
- func RemoveWatermarks(cmd *Command) ([]string, error)
- func Rotate(cmd *Command) ([]string, error)
- func SetPermissions(cmd *Command) ([]string, error)
- func Split(cmd *Command) ([]string, error)
- func Trim(cmd *Command) ([]string, error)
- func Validate(cmd *Command) ([]string, error)
- type Command
- func AddAttachmentsCommand(inFile, outFile string, fileNames []string, conf *pdfcpu.Configuration) *Command
- func AddAttachmentsPortfolioCommand(inFile, outFile string, fileNames []string, conf *pdfcpu.Configuration) *Command
- func AddBoxesCommand(inFile, outFile string, pageSelection []string, pb *pdfcpu.PageBoundaries, ...) *Command
- func AddKeywordsCommand(inFile, outFile string, keywords []string, conf *pdfcpu.Configuration) *Command
- func AddPropertiesCommand(inFile, outFile string, properties map[string]string, ...) *Command
- func AddWatermarksCommand(inFile, outFile string, pageSelection []string, wm *pdfcpu.Watermark, ...) *Command
- func BookletCommand(inFiles []string, outFile string, pageSelection []string, nup *pdfcpu.NUp, ...) *Command
- func ChangeOwnerPWCommand(inFile, outFile string, pwOld, pwNew *string, conf *pdfcpu.Configuration) *Command
- func ChangeUserPWCommand(inFile, outFile string, pwOld, pwNew *string, conf *pdfcpu.Configuration) *Command
- func CollectCommand(inFile, outFile string, pageSelection []string, conf *pdfcpu.Configuration) *Command
- func CreateCheatSheetsFontsCommand(fontFiles []string, conf *pdfcpu.Configuration) *Command
- func CreateCommand(inFileJSON, inFilePDF, outFilePDF string, conf *pdfcpu.Configuration) *Command
- func CropCommand(inFile, outFile string, pageSelection []string, box *pdfcpu.Box, ...) *Command
- func DecryptCommand(inFile, outFile string, conf *pdfcpu.Configuration) *Command
- func EncryptCommand(inFile, outFile string, conf *pdfcpu.Configuration) *Command
- func ExtractAttachmentsCommand(inFile string, outDir string, fileNames []string, conf *pdfcpu.Configuration) *Command
- func ExtractContentCommand(inFile string, outDir string, pageSelection []string, ...) *Command
- func ExtractFontsCommand(inFile string, outDir string, pageSelection []string, ...) *Command
- func ExtractImagesCommand(inFile string, outDir string, pageSelection []string, ...) *Command
- func ExtractMetadataCommand(inFile string, outDir string, conf *pdfcpu.Configuration) *Command
- func ExtractPagesCommand(inFile string, outDir string, pageSelection []string, ...) *Command
- func ImportImagesCommand(imageFiles []string, outFile string, imp *pdfcpu.Import, ...) *Command
- func InfoCommand(inFile string, pageSelection []string, conf *pdfcpu.Configuration) *Command
- func InsertPagesCommand(inFile, outFile string, pageSelection []string, conf *pdfcpu.Configuration, ...) *Command
- func InstallFontsCommand(fontFiles []string, conf *pdfcpu.Configuration) *Command
- func ListAnnotationsCommand(inFile string, pageSelection []string, conf *pdfcpu.Configuration) *Command
- func ListAttachmentsCommand(inFile string, conf *pdfcpu.Configuration) *Command
- func ListBoxesCommand(inFile string, pageSelection []string, pb *pdfcpu.PageBoundaries, ...) *Command
- func ListFontsCommand(conf *pdfcpu.Configuration) *Command
- func ListImagesCommand(inFiles []string, pageSelection []string, conf *pdfcpu.Configuration) *Command
- func ListKeywordsCommand(inFile string, conf *pdfcpu.Configuration) *Command
- func ListPermissionsCommand(inFile string, conf *pdfcpu.Configuration) *Command
- func ListPropertiesCommand(inFile string, conf *pdfcpu.Configuration) *Command
- func MergeAppendCommand(inFiles []string, outFile string, conf *pdfcpu.Configuration) *Command
- func MergeCreateCommand(inFiles []string, outFile string, conf *pdfcpu.Configuration) *Command
- func NUpCommand(inFiles []string, outFile string, pageSelection []string, nUp *pdfcpu.NUp, ...) *Command
- func OptimizeCommand(inFile, outFile string, conf *pdfcpu.Configuration) *Command
- func RemoveAnnotationsCommand(inFile, outFile string, pageSelection []string, objNrs []int, ...) *Command
- func RemoveAttachmentsCommand(inFile, outFile string, fileNames []string, conf *pdfcpu.Configuration) *Command
- func RemoveBoxesCommand(inFile, outFile string, pageSelection []string, pb *pdfcpu.PageBoundaries, ...) *Command
- func RemoveKeywordsCommand(inFile, outFile string, keywords []string, conf *pdfcpu.Configuration) *Command
- func RemovePagesCommand(inFile, outFile string, pageSelection []string, conf *pdfcpu.Configuration) *Command
- func RemovePropertiesCommand(inFile, outFile string, propKeys []string, conf *pdfcpu.Configuration) *Command
- func RemoveWatermarksCommand(inFile, outFile string, pageSelection []string, conf *pdfcpu.Configuration) *Command
- func RotateCommand(inFile, outFile string, rotation int, pageSelection []string, ...) *Command
- func SetPermissionsCommand(inFile, outFile string, conf *pdfcpu.Configuration) *Command
- func SplitCommand(inFile, dirNameOut string, span int, conf *pdfcpu.Configuration) *Command
- func TrimCommand(inFile, outFile string, pageSelection []string, conf *pdfcpu.Configuration) *Command
- func ValidateCommand(inFiles []string, conf *pdfcpu.Configuration) *Command
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAttachments ¶
AddAttachments embeds inFiles into a PDF context read from inFile and writes the result to outFile.
func AddBoxes ¶
AddBoxes adds page boundaries to inFile's page tree and writes the result to outFile.
func AddKeywords ¶
AddKeywords adds keywords to inFile's document info dict and writes the result to outFile.
func AddProperties ¶
AddProperties adds properties to inFile's document info dict and writes the result to outFile.
func AddWatermarks ¶
AddWatermarks adds watermarks or stamps to selected pages of inFile and writes the result to outFile.
func Booklet ¶
Booklet arranges selected PDF pages to outFile in an order and arrangement that form a small book.
func ChangeOwnerPassword ¶
ChangeOwnerPassword of inFile and write result to outFile.
func ChangeUserPassword ¶
ChangeUserPassword of inFile and write result to outFile.
func Collect ¶
Collect creates a custom page sequence for selected pages of inFile and writes result to outFile.
func Create ¶
Create renders page content corresponding to declarations found in inJSONFile and writes the result to outFile. If inFile is present, page content will be appended,
func CreateCheatSheetsFonts ¶
CreateCheatSheetsFonts creates single page PDF cheat sheets for user fonts in current dir.
func ExtractAttachments ¶
ExtractAttachments extracts inFiles from a PDF context read from inFile and writes the result to outFile.
func ExtractContent ¶
ExtractContent dumps "PDF source" files from inFile into outDir for selected pages.
func ExtractFonts ¶
ExtractFonts dumps embedded fontfiles from inFile into outDir for selected pages.
func ExtractImages ¶
ExtractImages dumps embedded image resources from inFile into outDir for selected pages.
func ExtractMetadata ¶
ExtractMetadata dumps all metadata dict entries for inFile into outDir.
func ExtractPages ¶
ExtractPages generates single page PDF files from inFile in outDir for selected pages.
func ImportImages ¶
ImportImages appends PDF pages containing images to outFile which will be created if necessary. ImportImages turns image files into a page sequence and writes the result to outFile. In its simplest form this operation converts an image into a PDF.
func InsertPages ¶
InsertPages inserts a blank page before or after each selected page.
func InstallFonts ¶
InstallFonts installs True Type fonts into the pdfcpu pconfig dir.
func ListAnnotations ¶
ListAnnotations returns inFile's page annotations.
func ListAttachments ¶
ListAttachments returns a list of embedded file attachments for inFile.
func ListFonts ¶
ListFonts gathers information about supported fonts and returns the result as []string.
func ListImages ¶
ListImages returns inFiles embedded images.
func ListKeywords ¶
ListKeywords returns a list of keywords for inFile.
func ListPermissions ¶
ListPermissions of inFile.
func ListProperties ¶
ListProperties returns inFile's properties.
func MergeAppend ¶
MergeAppend merges inFiles in the order specified and writes the result to outFile.
func MergeCreate ¶
MergeCreate merges inFiles in the order specified and writes the result to outFile.
func RemoveAnnotations ¶
RemoveAnnotations deletes annotations from inFile's page tree and writes the result to outFile.
func RemoveAttachments ¶
RemoveAttachments deletes inFiles from a PDF context read from inFile and writes the result to outFile.
func RemoveBoxes ¶
RemoveBoxes deletes page boundaries from inFile's page tree and writes the result to outFile.
func RemoveKeywords ¶
RemoveKeywords deletes keywords from inFile's document info dict and writes the result to outFile.
func RemovePages ¶
RemovePages removes selected pages.
func RemoveProperties ¶
RemoveProperties deletes properties from inFile's document info dict and writes the result to outFile.
func RemoveWatermarks ¶
RemoveWatermarks remove watermarks or stamps from selected pages of inFile and writes the result to outFile.
Types ¶
type Command ¶
type Command struct { Mode pdfcpu.CommandMode InFile *string InFiles []string InDir *string OutFile *string OutDir *string PageSelection []string Conf *pdfcpu.Configuration PWOld *string PWNew *string Watermark *pdfcpu.Watermark Span int Import *pdfcpu.Import Rotation int NUp *pdfcpu.NUp Input io.ReadSeeker Inputs []io.ReadSeeker Output io.Writer StringMap map[string]string Box *pdfcpu.Box PageBoundaries *pdfcpu.PageBoundaries IntVals []int // contains filtered or unexported fields }
Command represents an execution context.
func AddAttachmentsCommand ¶
func AddAttachmentsCommand(inFile, outFile string, fileNames []string, conf *pdfcpu.Configuration) *Command
AddAttachmentsCommand creates a new command to add attachments.
func AddAttachmentsPortfolioCommand ¶
func AddAttachmentsPortfolioCommand(inFile, outFile string, fileNames []string, conf *pdfcpu.Configuration) *Command
AddAttachmentsPortfolioCommand creates a new command to add attachments to a portfolio.
func AddBoxesCommand ¶
func AddBoxesCommand(inFile, outFile string, pageSelection []string, pb *pdfcpu.PageBoundaries, conf *pdfcpu.Configuration) *Command
AddBoxesCommand creates a new command to add page boundaries for selected pages.
func AddKeywordsCommand ¶
func AddKeywordsCommand(inFile, outFile string, keywords []string, conf *pdfcpu.Configuration) *Command
AddKeywordsCommand creates a new command to add keywords.
func AddPropertiesCommand ¶
func AddPropertiesCommand(inFile, outFile string, properties map[string]string, conf *pdfcpu.Configuration) *Command
AddPropertiesCommand creates a new command to add document properties.
func AddWatermarksCommand ¶
func AddWatermarksCommand(inFile, outFile string, pageSelection []string, wm *pdfcpu.Watermark, conf *pdfcpu.Configuration) *Command
AddWatermarksCommand creates a new command to add Watermarks to a file.
func BookletCommand ¶
func BookletCommand(inFiles []string, outFile string, pageSelection []string, nup *pdfcpu.NUp, conf *pdfcpu.Configuration) *Command
BookletCommand creates a new command to render PDFs or image files in booklet fashion.
func ChangeOwnerPWCommand ¶
func ChangeOwnerPWCommand(inFile, outFile string, pwOld, pwNew *string, conf *pdfcpu.Configuration) *Command
ChangeOwnerPWCommand creates a new command to change the owner password.
func ChangeUserPWCommand ¶
func ChangeUserPWCommand(inFile, outFile string, pwOld, pwNew *string, conf *pdfcpu.Configuration) *Command
ChangeUserPWCommand creates a new command to change the user password.
func CollectCommand ¶
func CollectCommand(inFile, outFile string, pageSelection []string, conf *pdfcpu.Configuration) *Command
CollectCommand creates a new command to create a custom PDF page sequence.
func CreateCheatSheetsFontsCommand ¶
func CreateCheatSheetsFontsCommand(fontFiles []string, conf *pdfcpu.Configuration) *Command
CreateCheatSheetsFontsCommand creates single page PDF cheat sheets in current dir.
func CreateCommand ¶
func CreateCommand(inFileJSON, inFilePDF, outFilePDF string, conf *pdfcpu.Configuration) *Command
CreateCommand creates a new command to create a PDF file.
func CropCommand ¶
func CropCommand(inFile, outFile string, pageSelection []string, box *pdfcpu.Box, conf *pdfcpu.Configuration) *Command
CropCommand creates a new command to apply a cropBox to selected pages.
func DecryptCommand ¶
func DecryptCommand(inFile, outFile string, conf *pdfcpu.Configuration) *Command
DecryptCommand creates a new command to decrypt a file.
func EncryptCommand ¶
func EncryptCommand(inFile, outFile string, conf *pdfcpu.Configuration) *Command
EncryptCommand creates a new command to encrypt a file.
func ExtractAttachmentsCommand ¶
func ExtractAttachmentsCommand(inFile string, outDir string, fileNames []string, conf *pdfcpu.Configuration) *Command
ExtractAttachmentsCommand creates a new command to extract attachments.
func ExtractContentCommand ¶
func ExtractContentCommand(inFile string, outDir string, pageSelection []string, conf *pdfcpu.Configuration) *Command
ExtractContentCommand creates a new command to extract page content streams.
func ExtractFontsCommand ¶
func ExtractFontsCommand(inFile string, outDir string, pageSelection []string, conf *pdfcpu.Configuration) *Command
ExtractFontsCommand creates a new command to extract embedded fonts. (experimental)
func ExtractImagesCommand ¶
func ExtractImagesCommand(inFile string, outDir string, pageSelection []string, conf *pdfcpu.Configuration) *Command
ExtractImagesCommand creates a new command to extract embedded images. (experimental)
func ExtractMetadataCommand ¶
func ExtractMetadataCommand(inFile string, outDir string, conf *pdfcpu.Configuration) *Command
ExtractMetadataCommand creates a new command to extract metadata streams.
func ExtractPagesCommand ¶
func ExtractPagesCommand(inFile string, outDir string, pageSelection []string, conf *pdfcpu.Configuration) *Command
ExtractPagesCommand creates a new command to extract specific pages of a file.
func ImportImagesCommand ¶
func ImportImagesCommand(imageFiles []string, outFile string, imp *pdfcpu.Import, conf *pdfcpu.Configuration) *Command
ImportImagesCommand creates a new command to import images.
func InfoCommand ¶
func InfoCommand(inFile string, pageSelection []string, conf *pdfcpu.Configuration) *Command
InfoCommand creates a new command to output information about inFile.
func InsertPagesCommand ¶
func InsertPagesCommand(inFile, outFile string, pageSelection []string, conf *pdfcpu.Configuration, mode string) *Command
InsertPagesCommand creates a new command to insert a blank page before or after selected pages.
func InstallFontsCommand ¶
func InstallFontsCommand(fontFiles []string, conf *pdfcpu.Configuration) *Command
InstallFontsCommand installs true type fonts for embedding.
func ListAnnotationsCommand ¶
func ListAnnotationsCommand(inFile string, pageSelection []string, conf *pdfcpu.Configuration) *Command
ListAnnotationsCommand creates a new command to list annotations for selected pages.
func ListAttachmentsCommand ¶
func ListAttachmentsCommand(inFile string, conf *pdfcpu.Configuration) *Command
ListAttachmentsCommand create a new command to list attachments.
func ListBoxesCommand ¶
func ListBoxesCommand(inFile string, pageSelection []string, pb *pdfcpu.PageBoundaries, conf *pdfcpu.Configuration) *Command
ListBoxesCommand creates a new command to list page boundaries for selected pages.
func ListFontsCommand ¶
func ListFontsCommand(conf *pdfcpu.Configuration) *Command
ListFontsCommand returns a list of supported fonts.
func ListImagesCommand ¶
func ListImagesCommand(inFiles []string, pageSelection []string, conf *pdfcpu.Configuration) *Command
ListImagesCommand creates a new command to list annotations for selected pages.
func ListKeywordsCommand ¶
func ListKeywordsCommand(inFile string, conf *pdfcpu.Configuration) *Command
ListKeywordsCommand create a new command to list keywords.
func ListPermissionsCommand ¶
func ListPermissionsCommand(inFile string, conf *pdfcpu.Configuration) *Command
ListPermissionsCommand create a new command to list permissions.
func ListPropertiesCommand ¶
func ListPropertiesCommand(inFile string, conf *pdfcpu.Configuration) *Command
ListPropertiesCommand creates a new command to list document properties.
func MergeAppendCommand ¶
func MergeAppendCommand(inFiles []string, outFile string, conf *pdfcpu.Configuration) *Command
MergeAppendCommand creates a new command to merge files. Any existing outFile PDF content will be preserved and serves as the beginning of the merge result.
func MergeCreateCommand ¶
func MergeCreateCommand(inFiles []string, outFile string, conf *pdfcpu.Configuration) *Command
MergeCreateCommand creates a new command to merge files. Outfile will be created. An existing outFile will be overwritten.
func NUpCommand ¶
func NUpCommand(inFiles []string, outFile string, pageSelection []string, nUp *pdfcpu.NUp, conf *pdfcpu.Configuration) *Command
NUpCommand creates a new command to render PDFs or image files in n-up fashion.
func OptimizeCommand ¶
func OptimizeCommand(inFile, outFile string, conf *pdfcpu.Configuration) *Command
OptimizeCommand creates a new command to optimize a file.
func RemoveAnnotationsCommand ¶
func RemoveAnnotationsCommand(inFile, outFile string, pageSelection []string, objNrs []int, conf *pdfcpu.Configuration) *Command
RemoveAnnotationsCommand creates a new command to remove annotations for selected pages.
func RemoveAttachmentsCommand ¶
func RemoveAttachmentsCommand(inFile, outFile string, fileNames []string, conf *pdfcpu.Configuration) *Command
RemoveAttachmentsCommand creates a new command to remove attachments.
func RemoveBoxesCommand ¶
func RemoveBoxesCommand(inFile, outFile string, pageSelection []string, pb *pdfcpu.PageBoundaries, conf *pdfcpu.Configuration) *Command
RemoveBoxesCommand creates a new command to remove page boundaries for selected pages.
func RemoveKeywordsCommand ¶
func RemoveKeywordsCommand(inFile, outFile string, keywords []string, conf *pdfcpu.Configuration) *Command
RemoveKeywordsCommand creates a new command to remove keywords.
func RemovePagesCommand ¶
func RemovePagesCommand(inFile, outFile string, pageSelection []string, conf *pdfcpu.Configuration) *Command
RemovePagesCommand creates a new command to remove selected pages.
func RemovePropertiesCommand ¶
func RemovePropertiesCommand(inFile, outFile string, propKeys []string, conf *pdfcpu.Configuration) *Command
RemovePropertiesCommand creates a new command to remove document properties.
func RemoveWatermarksCommand ¶
func RemoveWatermarksCommand(inFile, outFile string, pageSelection []string, conf *pdfcpu.Configuration) *Command
RemoveWatermarksCommand creates a new command to remove Watermarks from a file.
func RotateCommand ¶
func RotateCommand(inFile, outFile string, rotation int, pageSelection []string, conf *pdfcpu.Configuration) *Command
RotateCommand creates a new command to rotate pages.
func SetPermissionsCommand ¶
func SetPermissionsCommand(inFile, outFile string, conf *pdfcpu.Configuration) *Command
SetPermissionsCommand creates a new command to add permissions.
func SplitCommand ¶
func SplitCommand(inFile, dirNameOut string, span int, conf *pdfcpu.Configuration) *Command
SplitCommand creates a new command to split a file into single page files.
func TrimCommand ¶
func TrimCommand(inFile, outFile string, pageSelection []string, conf *pdfcpu.Configuration) *Command
TrimCommand creates a new command to trim the pages of a file.
func ValidateCommand ¶
func ValidateCommand(inFiles []string, conf *pdfcpu.Configuration) *Command
ValidateCommand creates a new command to validate a file.