pdfcpu: github.com/pdfcpu/pdfcpu/pkg/cli Index | Files

package cli

import "github.com/pdfcpu/pdfcpu/pkg/cli"

Package cli provides pdfcpu command line processing.

Index

Package Files

cli.go process.go

func AddAttachments Uses

func AddAttachments(cmd *Command) ([]string, error)

AddAttachments embeds inFiles into a PDF context read from inFile and writes the result to outFile.

func AddKeywords Uses

func AddKeywords(cmd *Command) ([]string, error)

AddKeywords adds keywords to inFile's document info dict and writes the result to outFile.

func AddProperties Uses

func AddProperties(cmd *Command) ([]string, error)

AddProperties adds properties to inFile's document info dict and writes the result to outFile.

func AddWatermarks Uses

func AddWatermarks(cmd *Command) ([]string, error)

AddWatermarks adds watermarks or stamps to selected pages of inFile and writes the result to outFile.

func ChangeOwnerPassword Uses

func ChangeOwnerPassword(cmd *Command) ([]string, error)

ChangeOwnerPassword of inFile and write result to outFile.

func ChangeUserPassword Uses

func ChangeUserPassword(cmd *Command) ([]string, error)

ChangeUserPassword of inFile and write result to outFile.

func Collect Uses

func Collect(cmd *Command) ([]string, error)

Collect creates a custom page sequence for selected pages of inFile and writes result to outFile.

func Decrypt Uses

func Decrypt(cmd *Command) ([]string, error)

Decrypt inFile and write result to outFile.

func Encrypt Uses

func Encrypt(cmd *Command) ([]string, error)

Encrypt inFile and write result to outFile.

func ExtractAttachments Uses

func ExtractAttachments(cmd *Command) ([]string, error)

ExtractAttachments extracts inFiles from a PDF context read from inFile and writes the result to outFile.

func ExtractContent Uses

func ExtractContent(cmd *Command) ([]string, error)

ExtractContent dumps "PDF source" files from inFile into outDir for selected pages.

func ExtractFonts Uses

func ExtractFonts(cmd *Command) ([]string, error)

ExtractFonts dumps embedded fontfiles from inFile into outDir for selected pages.

func ExtractImages Uses

func ExtractImages(cmd *Command) ([]string, error)

ExtractImages dumps embedded image resources from inFile into outDir for selected pages.

func ExtractMetadata Uses

func ExtractMetadata(cmd *Command) ([]string, error)

ExtractMetadata dumps all metadata dict entries for inFile into outDir.

func ExtractPages Uses

func ExtractPages(cmd *Command) ([]string, error)

ExtractPages generates single page PDF files from inFile in outDir for selected pages.

func ImportImages Uses

func ImportImages(cmd *Command) ([]string, error)

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 Info Uses

func Info(cmd *Command) ([]string, error)

Info gathers information about inFile and returns the result as []string.

func InsertPages Uses

func InsertPages(cmd *Command) ([]string, error)

InsertPages inserts a blank page before or after each selected page.

func InstallFonts Uses

func InstallFonts(cmd *Command) ([]string, error)

InstallFonts gathers information about supported fonts and returns the result as []string.

func ListAttachments Uses

func ListAttachments(cmd *Command) ([]string, error)

ListAttachments returns a list of embedded file attachments for inFile.

func ListFonts Uses

func ListFonts(cmd *Command) ([]string, error)

ListFonts gathers information about supported fonts and returns the result as []string.

func ListKeywords Uses

func ListKeywords(cmd *Command) ([]string, error)

ListKeywords returns a list of keywords for inFile.

func ListPermissions Uses

func ListPermissions(cmd *Command) ([]string, error)

ListPermissions of inFile.

func ListProperties Uses

func ListProperties(cmd *Command) ([]string, error)

ListProperties returns inFile's properties.

func MergeAppend Uses

func MergeAppend(cmd *Command) ([]string, error)

MergeAppend merges inFiles in the order specified and writes the result to outFile.

func MergeCreate Uses

func MergeCreate(cmd *Command) ([]string, error)

MergeCreate merges inFiles in the order specified and writes the result to outFile.

func NUp Uses

func NUp(cmd *Command) ([]string, error)

NUp renders selected PDF pages or image files to outFile in n-up fashion.

func Optimize Uses

func Optimize(cmd *Command) ([]string, error)

Optimize inFile and write result to outFile.

func Process Uses

func Process(cmd *Command) (out []string, err error)

Process executes a pdfcpu command.

func RemoveAttachments Uses

func RemoveAttachments(cmd *Command) ([]string, error)

RemoveAttachments deletes inFiles from a PDF context read from inFile and writes the result to outFile.

func RemoveKeywords Uses

func RemoveKeywords(cmd *Command) ([]string, error)

RemoveKeywords deletes keywords from inFile's document info dict and writes the result to outFile.

func RemovePages Uses

func RemovePages(cmd *Command) ([]string, error)

RemovePages removes selected pages.

func RemoveProperties Uses

func RemoveProperties(cmd *Command) ([]string, error)

RemoveProperties deletes properties from inFile's document info dict and writes the result to outFile.

func RemoveWatermarks Uses

func RemoveWatermarks(cmd *Command) ([]string, error)

RemoveWatermarks remove watermarks or stamps from selected pages of inFile and writes the result to outFile.

func Rotate Uses

func Rotate(cmd *Command) ([]string, error)

Rotate rotates selected pages of inFile and writes result to outFile.

func SetPermissions Uses

func SetPermissions(cmd *Command) ([]string, error)

SetPermissions of inFile.

func Split Uses

func Split(cmd *Command) ([]string, error)

Split inFile into single page PDFs and write result files to outDir.

func Trim Uses

func Trim(cmd *Command) ([]string, error)

Trim inFile and write result to outFile.

func Validate Uses

func Validate(cmd *Command) ([]string, error)

Validate inFile against ISO-32000-1:2008.

type Command Uses

type Command struct {
    Mode          pdf.CommandMode
    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
    StringMap     map[string]string
}

Command represents an execution context.

func AddAttachmentsCommand Uses

func AddAttachmentsCommand(inFile, outFile string, fileNames []string, conf *pdf.Configuration) *Command

AddAttachmentsCommand creates a new command to add attachments.

func AddAttachmentsPortfolioCommand Uses

func AddAttachmentsPortfolioCommand(inFile, outFile string, fileNames []string, conf *pdf.Configuration) *Command

AddAttachmentsPortfolioCommand creates a new command to add attachments to a portfolio.

func AddKeywordsCommand Uses

func AddKeywordsCommand(inFile, outFile string, keywords []string, conf *pdf.Configuration) *Command

AddKeywordsCommand creates a new command to add keywords.

func AddPropertiesCommand Uses

func AddPropertiesCommand(inFile, outFile string, properties map[string]string, conf *pdf.Configuration) *Command

AddPropertiesCommand creates a new command to add document properties.

func AddWatermarksCommand Uses

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 Uses

func ChangeOwnerPWCommand(inFile, outFile string, pwOld, pwNew *string, conf *pdf.Configuration) *Command

ChangeOwnerPWCommand creates a new command to change the owner password.

func ChangeUserPWCommand Uses

func ChangeUserPWCommand(inFile, outFile string, pwOld, pwNew *string, conf *pdf.Configuration) *Command

ChangeUserPWCommand creates a new command to change the user password.

func CollectCommand Uses

func CollectCommand(inFile, outFile string, pageSelection []string, conf *pdf.Configuration) *Command

CollectCommand creates a new command to create a custom PDF page sequence.

func DecryptCommand Uses

func DecryptCommand(inFile, outFile string, conf *pdf.Configuration) *Command

DecryptCommand creates a new command to decrypt a file.

func EncryptCommand Uses

func EncryptCommand(inFile, outFile string, conf *pdf.Configuration) *Command

EncryptCommand creates a new command to encrypt a file.

func ExtractAttachmentsCommand Uses

func ExtractAttachmentsCommand(inFile string, outDir string, fileNames []string, conf *pdf.Configuration) *Command

ExtractAttachmentsCommand creates a new command to extract attachments.

func ExtractContentCommand Uses

func ExtractContentCommand(inFile string, outDir string, pageSelection []string, conf *pdf.Configuration) *Command

ExtractContentCommand creates a new command to extract page content streams.

func ExtractFontsCommand Uses

func ExtractFontsCommand(inFile string, outDir string, pageSelection []string, conf *pdf.Configuration) *Command

ExtractFontsCommand creates a new command to extract embedded fonts. (experimental)

func ExtractImagesCommand Uses

func ExtractImagesCommand(inFile string, outDir string, pageSelection []string, conf *pdf.Configuration) *Command

ExtractImagesCommand creates a new command to extract embedded images. (experimental)

func ExtractMetadataCommand Uses

func ExtractMetadataCommand(inFile string, outDir string, conf *pdf.Configuration) *Command

ExtractMetadataCommand creates a new command to extract metadata streams.

func ExtractPagesCommand Uses

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 Uses

func ImportImagesCommand(imageFiles []string, outFile string, imp *pdf.Import, conf *pdf.Configuration) *Command

ImportImagesCommand creates a new command to import images.

func InfoCommand Uses

func InfoCommand(inFile string, conf *pdf.Configuration) *Command

InfoCommand creates a new command to output information about inFile.

func InsertPagesCommand Uses

func InsertPagesCommand(inFile, outFile string, pageSelection []string, conf *pdf.Configuration, mode string) *Command

InsertPagesCommand creates a new command to insert a blank page before or after selected pages.

func InstallFontsCommand Uses

func InstallFontsCommand(fontFiles []string, conf *pdf.Configuration) *Command

InstallFontsCommand installs true type fonts for embedding.

func ListAttachmentsCommand Uses

func ListAttachmentsCommand(inFile string, conf *pdf.Configuration) *Command

ListAttachmentsCommand create a new command to list attachments.

func ListFontsCommand Uses

func ListFontsCommand(conf *pdf.Configuration) *Command

ListFontsCommand returns a list of supported fonts.

func ListKeywordsCommand Uses

func ListKeywordsCommand(inFile string, conf *pdf.Configuration) *Command

ListKeywordsCommand create a new command to list keywords.

func ListPermissionsCommand Uses

func ListPermissionsCommand(inFile string, conf *pdf.Configuration) *Command

ListPermissionsCommand create a new command to list permissions.

func ListPropertiesCommand Uses

func ListPropertiesCommand(inFile string, conf *pdf.Configuration) *Command

ListPropertiesCommand creates a new command to list document properties.

func MergeAppendCommand Uses

func MergeAppendCommand(inFiles []string, outFile string, conf *pdf.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 Uses

func MergeCreateCommand(inFiles []string, outFile string, conf *pdf.Configuration) *Command

MergeCreateCommand creates a new command to merge files. Outfile will be created. An existing outFile will be overwritten.

func NUpCommand Uses

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 Uses

func OptimizeCommand(inFile, outFile string, conf *pdf.Configuration) *Command

OptimizeCommand creates a new command to optimize a file.

func RemoveAttachmentsCommand Uses

func RemoveAttachmentsCommand(inFile, outFile string, fileNames []string, conf *pdf.Configuration) *Command

RemoveAttachmentsCommand creates a new command to remove attachments.

func RemoveKeywordsCommand Uses

func RemoveKeywordsCommand(inFile, outFile string, keywords []string, conf *pdf.Configuration) *Command

RemoveKeywordsCommand creates a new command to remove keywords.

func RemovePagesCommand Uses

func RemovePagesCommand(inFile, outFile string, pageSelection []string, conf *pdf.Configuration) *Command

RemovePagesCommand creates a new command to remove selected pages.

func RemovePropertiesCommand Uses

func RemovePropertiesCommand(inFile, outFile string, propKeys []string, conf *pdf.Configuration) *Command

RemovePropertiesCommand creates a new command to remove document properties.

func RemoveWatermarksCommand Uses

func RemoveWatermarksCommand(inFile, outFile string, pageSelection []string, conf *pdf.Configuration) *Command

RemoveWatermarksCommand creates a new command to remove Watermarks from a file.

func RotateCommand Uses

func RotateCommand(inFile, outFile string, rotation int, pageSelection []string, conf *pdf.Configuration) *Command

RotateCommand creates a new command to rotate pages.

func SetPermissionsCommand Uses

func SetPermissionsCommand(inFile, outFile string, conf *pdf.Configuration) *Command

SetPermissionsCommand creates a new command to add permissions.

func SplitCommand Uses

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 Uses

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 Uses

func ValidateCommand(inFile string, conf *pdf.Configuration) *Command

ValidateCommand creates a new command to validate a file.

Package cli imports 4 packages (graph) and is imported by 1 packages. Updated 2020-05-26. Refresh now. Tools for package owners.