Documentation ¶
Overview ¶
Package cli provides pdfcpu command line processing.
Index ¶
- func AddAttachments(cmd *Command) ([]string, error)
- func AddWatermarks(cmd *Command) ([]string, error)
- func ChangeOwnerPassword(cmd *Command) ([]string, error)
- func ChangeUserPassword(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 ListAttachments(cmd *Command) ([]string, error)
- func ListPermissions(cmd *Command) ([]string, error)
- func Merge(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 RemoveAttachments(cmd *Command) ([]string, error)
- func RemovePages(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 *pdf.Configuration) *Command
- func AddWatermarksCommand(inFile, outFile string, pageSelection []string, wm *pdf.Watermark, ...) *Command
- func ChangeOwnerPWCommand(inFile, outFile string, pwOld, pwNew *string, conf *pdf.Configuration) *Command
- func ChangeUserPWCommand(inFile, outFile string, pwOld, pwNew *string, conf *pdf.Configuration) *Command
- func DecryptCommand(inFile, outFile string, conf *pdf.Configuration) *Command
- func EncryptCommand(inFile, outFile string, conf *pdf.Configuration) *Command
- func ExtractAttachmentsCommand(inFile string, outDir string, fileNames []string, conf *pdf.Configuration) *Command
- func ExtractContentCommand(inFile string, outDir string, pageSelection []string, conf *pdf.Configuration) *Command
- func ExtractFontsCommand(inFile string, outDir string, pageSelection []string, conf *pdf.Configuration) *Command
- func ExtractImagesCommand(inFile string, outDir string, pageSelection []string, conf *pdf.Configuration) *Command
- func ExtractMetadataCommand(inFile string, outDir string, conf *pdf.Configuration) *Command
- func ExtractPagesCommand(inFile string, outDir string, pageSelection []string, conf *pdf.Configuration) *Command
- func ImportImagesCommand(imageFiles []string, outFile string, imp *pdf.Import, conf *pdf.Configuration) *Command
- func InfoCommand(inFile string, conf *pdf.Configuration) *Command
- func InsertPagesCommand(inFile, outFile string, pageSelection []string, conf *pdf.Configuration) *Command
- func ListAttachmentsCommand(inFile string, conf *pdf.Configuration) *Command
- func ListPermissionsCommand(inFile string, conf *pdf.Configuration) *Command
- func MergeCommand(inFiles []string, outFile string, conf *pdf.Configuration) *Command
- func NUpCommand(inFiles []string, outFile string, pageSelection []string, nUp *pdf.NUp, ...) *Command
- func OptimizeCommand(inFile, outFile string, conf *pdf.Configuration) *Command
- func RemoveAttachmentsCommand(inFile, outFile string, fileNames []string, conf *pdf.Configuration) *Command
- func RemovePagesCommand(inFile, outFile string, pageSelection []string, conf *pdf.Configuration) *Command
- func RotateCommand(inFile, outFile string, rotation int, pageSelection []string, ...) *Command
- func SetPermissionsCommand(inFile, outFile string, conf *pdf.Configuration) *Command
- func SplitCommand(inFile, dirNameOut string, span int, conf *pdf.Configuration) *Command
- func TrimCommand(inFile, outFile string, pageSelection []string, conf *pdf.Configuration) *Command
- func ValidateCommand(inFile string, conf *pdf.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 AddWatermarks ¶
AddWatermarks adds watermarks or stamps to selected pages of inFile and writes the result to outFile.
func ChangeOwnerPassword ¶
ChangeOwnerPassword of inFile and write result to outFile.
func ChangeUserPassword ¶
ChangeUserPassword of inFile and write result to outFile.
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 each selected page.
func ListAttachments ¶
ListAttachments returns a list of embedded file attachments for inFile.
func ListPermissions ¶
ListPermissions of inFile.
func RemoveAttachments ¶
RemoveAttachments deletes inFiles from a PDF context read from inFile and writes the result to outFile.
func RemovePages ¶
RemovePages removes selected pages.
Types ¶
type Command ¶
type Command struct { Mode pdf.CommandMode // VALIDATE OPTIMIZE SPLIT MERGE EXTRACT TRIM LISTATT ADDATT REMATT EXTATT ENCRYPT DECRYPT CHANGEUPW CHANGEOPW LISTP ADDP WATERMARK IMPORT INSERTP REMOVEP ROTATE NUP InFile *string // * * * - * * * * * * * * * * * * * - * * * - InFiles []string // - - - * - - - * * * - - - - - - - * - - - * InDir *string // - - - - - - - - - - - - - - - - - - - - - - OutFile *string // - * - * - * - - - - * * * * - - * * * * - * OutDir *string // - - * - * - - - - * - - - - - - - - - - - - PageSelection []string // - - - - * * - - - - - - - - - - * - * * - * Conf *pdf.Configuration // * * * * * * * * * * * * * * * * * * * * * * PWOld *string // - - - - - - - - - - - - * * - - - - - - - - PWNew *string // - - - - - - - - - - - - * * - - - - - - - - Watermark *pdf.Watermark // - - - - - - - - - - - - - - - - - - - - - - Span int // - - * - - - - - - - - - - - - - - - - - - - Import *pdf.Import // - - - - - - - - - - - - - - - - - * - - - - Rotation int // - - - - - - - - - - - - - - - - - - - - * - NUp *pdf.NUp // - - - - - - - - - - - - - - - - - - - - - * Input io.ReadSeeker Inputs []io.ReadSeeker Output io.Writer }
Command represents an execution context.
func AddAttachmentsCommand ¶
func AddAttachmentsCommand(inFile, outFile string, fileNames []string, conf *pdf.Configuration) *Command
AddAttachmentsCommand creates a new command to add attachments.
func AddWatermarksCommand ¶
func AddWatermarksCommand(inFile, outFile string, pageSelection []string, wm *pdf.Watermark, conf *pdf.Configuration) *Command
AddWatermarksCommand creates a new command to add Watermarks to a file.
func ChangeOwnerPWCommand ¶
func ChangeOwnerPWCommand(inFile, outFile string, pwOld, pwNew *string, conf *pdf.Configuration) *Command
ChangeOwnerPWCommand creates a new command to change the owner password.
func ChangeUserPWCommand ¶
func ChangeUserPWCommand(inFile, outFile string, pwOld, pwNew *string, conf *pdf.Configuration) *Command
ChangeUserPWCommand creates a new command to change the user password.
func DecryptCommand ¶
func DecryptCommand(inFile, outFile string, conf *pdf.Configuration) *Command
DecryptCommand creates a new command to decrypt a file.
func EncryptCommand ¶
func EncryptCommand(inFile, outFile string, conf *pdf.Configuration) *Command
EncryptCommand creates a new command to encrypt a file.
func ExtractAttachmentsCommand ¶
func ExtractAttachmentsCommand(inFile string, outDir string, fileNames []string, conf *pdf.Configuration) *Command
ExtractAttachmentsCommand creates a new command to extract attachments.
func ExtractContentCommand ¶
func ExtractContentCommand(inFile string, outDir string, pageSelection []string, conf *pdf.Configuration) *Command
ExtractContentCommand creates a new command to extract page content streams.
func ExtractFontsCommand ¶
func ExtractFontsCommand(inFile string, outDir string, pageSelection []string, conf *pdf.Configuration) *Command
ExtractFontsCommand creates a new command to extract embedded fonts. (experimental)
func ExtractImagesCommand ¶
func ExtractImagesCommand(inFile string, outDir string, pageSelection []string, conf *pdf.Configuration) *Command
ExtractImagesCommand creates a new command to extract embedded images. (experimental
func ExtractMetadataCommand ¶
func ExtractMetadataCommand(inFile string, outDir string, conf *pdf.Configuration) *Command
ExtractMetadataCommand creates a new command to extract metadata streams.
func ExtractPagesCommand ¶
func ExtractPagesCommand(inFile string, outDir string, pageSelection []string, conf *pdf.Configuration) *Command
ExtractPagesCommand creates a new command to extract specific pages of a file.
func ImportImagesCommand ¶
func ImportImagesCommand(imageFiles []string, outFile string, imp *pdf.Import, conf *pdf.Configuration) *Command
ImportImagesCommand creates a new command to import images.
func InfoCommand ¶
func InfoCommand(inFile string, conf *pdf.Configuration) *Command
InfoCommand creates a new command to output information about inFile.
func InsertPagesCommand ¶
func InsertPagesCommand(inFile, outFile string, pageSelection []string, conf *pdf.Configuration) *Command
InsertPagesCommand creates a new command to insert a blank page before selected pages.
func ListAttachmentsCommand ¶
func ListAttachmentsCommand(inFile string, conf *pdf.Configuration) *Command
ListAttachmentsCommand create a new command to list attachments.
func ListPermissionsCommand ¶
func ListPermissionsCommand(inFile string, conf *pdf.Configuration) *Command
ListPermissionsCommand create a new command to list permissions.
func MergeCommand ¶
func MergeCommand(inFiles []string, outFile string, conf *pdf.Configuration) *Command
MergeCommand creates a new command to merge files.
func NUpCommand ¶
func NUpCommand(inFiles []string, outFile string, pageSelection []string, nUp *pdf.NUp, conf *pdf.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 *pdf.Configuration) *Command
OptimizeCommand creates a new command to optimize a file.
func RemoveAttachmentsCommand ¶
func RemoveAttachmentsCommand(inFile, outFile string, fileNames []string, conf *pdf.Configuration) *Command
RemoveAttachmentsCommand creates a new command to remove attachments.
func RemovePagesCommand ¶
func RemovePagesCommand(inFile, outFile string, pageSelection []string, conf *pdf.Configuration) *Command
RemovePagesCommand creates a new command to remove selected pages.
func RotateCommand ¶
func RotateCommand(inFile, outFile string, rotation int, pageSelection []string, conf *pdf.Configuration) *Command
RotateCommand creates a new command to rotate pages.
func SetPermissionsCommand ¶
func SetPermissionsCommand(inFile, outFile string, conf *pdf.Configuration) *Command
SetPermissionsCommand creates a new command to add permissions.
func SplitCommand ¶
func SplitCommand(inFile, dirNameOut string, span int, conf *pdf.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 *pdf.Configuration) *Command
TrimCommand creates a new command to trim the pages of a file.
func ValidateCommand ¶
func ValidateCommand(inFile string, conf *pdf.Configuration) *Command
ValidateCommand creates a new command to validate a file.