diff --git a/README.md b/README.md index 3613b72b..80b52c22 100644 --- a/README.md +++ b/README.md @@ -68,11 +68,11 @@ Even if you want to dive right into pdfcpu backend integration it is highly reco ## Status -[Version: 0.1.24](https://github.com/hhrutter/pdfcpu/releases/tag/v0.1.24) +[Version: 0.1.25](https://github.com/hhrutter/pdfcpu/releases/tag/v0.1.25) * Rudimentory support for AES-256 encryption as laid out in [AdobeĀ® Supplement to the ISO 32000 BaseVersion: 1.7 ExtensionLevel: 3](https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/adobe_supplement_iso32000.pdf) -* Fixes #74-#77, #80-#83, #85, #86 +* Fixes #88 ## Reminder diff --git a/cmd/pdfcpu/main.go b/cmd/pdfcpu/main.go index 4e8af61e..ca672c95 100644 --- a/cmd/pdfcpu/main.go +++ b/cmd/pdfcpu/main.go @@ -178,9 +178,6 @@ func main() { os.Exit(1) } - config.OwnerPW = opw - config.UserPW = upw - if cmd != nil { process(cmd) } diff --git a/cmd/pdfcpu/prepare.go b/cmd/pdfcpu/prepare.go index 9b2feeea..49b77562 100644 --- a/cmd/pdfcpu/prepare.go +++ b/cmd/pdfcpu/prepare.go @@ -438,8 +438,6 @@ func validateEncryptModeFlag() { } func validateEncryptFlags() { - fmt.Printf("mode:<%s> key:<%s>\n", mode, key) - validateEncryptModeFlag() if perm != "none" && perm != "all" && perm != "" { @@ -464,7 +462,7 @@ func prepareEncryptCommand(config *pdfcpu.Configuration) *api.Command { } if config.OwnerPW == "" { - fmt.Fprintf(os.Stderr, "missing non-empty owner password") + fmt.Fprintln(os.Stderr, "missing non-empty owner password!") fmt.Fprintf(os.Stderr, "%s\n\n", usageEncrypt) os.Exit(1) } @@ -566,7 +564,6 @@ func prepareWatermarksCommand(config *pdfcpu.Configuration, onTop bool) *api.Com os.Exit(1) } - //fmt.Printf("details: <%s>\n", flag.Arg(0)) wm, err := pdfcpu.ParseWatermarkDetails(flag.Arg(0), onTop) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) @@ -635,7 +632,6 @@ func prepareImportImagesCommand(config *pdfcpu.Configuration) *api.Command { } // pdfcpu import description outFile imageFile... - //fmt.Printf("details: <%s>\n", flag.Arg(0)) imp, err := pdfcpu.ParseImportDetails(flag.Arg(0)) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) @@ -819,7 +815,6 @@ func prepareNUpCommand(config *pdfcpu.Configuration) *api.Command { } // pdfcpu nup description outFile n inFile|imageFiles... - //fmt.Printf("details: <%s>\n", flag.Arg(0)) err = pdfcpu.ParseNUpDetails(flag.Arg(0), nup) if err != nil { fmt.Fprintf(os.Stderr, "%s\n", err) @@ -859,7 +854,6 @@ func prepareGridCommand(config *pdfcpu.Configuration) *api.Command { } // pdfcpu grid description outFile m n inFile|imageFiles... - //fmt.Printf("details: <%s>\n", flag.Arg(0)) err = pdfcpu.ParseNUpDetails(flag.Arg(0), nup) if err != nil { fmt.Fprintf(os.Stderr, "%s\n", err) diff --git a/cmd/pdfcpu/registry.go b/cmd/pdfcpu/registry.go index 175d9f8c..090b5ca2 100644 --- a/cmd/pdfcpu/registry.go +++ b/cmd/pdfcpu/registry.go @@ -78,6 +78,9 @@ func (m CommandMap) Handle(cmdPrefix string, command string, config *pdfcpu.Conf parseFlags(m[cmdStr]) + config.OwnerPW = opw + config.UserPW = upw + if m[cmdStr].handler != nil { return m[cmdStr].handler(config), command, nil } diff --git a/pkg/pdfcpu/imageRead.go b/pkg/pdfcpu/imageRead.go index 4b65eba1..d5e86bfd 100644 --- a/pkg/pdfcpu/imageRead.go +++ b/pkg/pdfcpu/imageRead.go @@ -17,7 +17,6 @@ limitations under the License. package pdfcpu import ( - "fmt" "image" "image/color" "image/jpeg" @@ -351,7 +350,7 @@ func imgToImageDict(xRefTable *XRefTable, img image.Image) (*StreamDict, error) // fmt.Println("YCbCr") default: - fmt.Printf("unknown color model: %T\n", img) + //fmt.Printf("unknown color model: %T\n", img) return nil, ErrUnsupportedColorSpace } diff --git a/pkg/pdfcpu/version.go b/pkg/pdfcpu/version.go index e464938a..dac59c9c 100644 --- a/pkg/pdfcpu/version.go +++ b/pkg/pdfcpu/version.go @@ -24,7 +24,7 @@ import ( const ( // PDFCPUVersion returns the current pdfcpu version. - PDFCPUVersion = "0.1.24" + PDFCPUVersion = "0.1.25" // PDFCPULongVersion returns pdfcpu's signature. PDFCPULongVersion = "pdfcpu v" + PDFCPUVersion