Skip to content

@hhrutter hhrutter released this Nov 15, 2019 · 7 commits to master since this release

Another watermark focused release comes with full support for the Adobe standard/core fontset.
The new pdfcpu fonts command prints the fontnames of all supported fonts:

Go-> pdfcpu fonts
Courier
Courier-Bold
Courier-BoldOblique
Courier-Oblique
Helvetica
Helvetica-Bold
Helvetica-BoldOblique
Helvetica-Oblique
Symbol
Times-Bold
Times-BoldItalic
Times-Italic
Times-Roman
ZapfDingbats

pkg/testdata/fontsamples contains single page PDF files - each stamped with the full character set of one of the supported fonts for your reference. The corresponding test for producing these files is located here:
pkg/api/api_test.go: TestCreateFontSamples

All characters regular or special are supported like € or eg. the german äöüÄÖÜß

In order to fully support creating watermarks/stamps containing any character a cli change was necessary:

pdfcpu stamp add    [-v(erbose)|vv] [-q(uiet)] [-pages selectedPages] [-upw userpw] [-opw ownerpw] -mode text|image|pdf string|file description inFile [outFile]
pdfcpu stamp remove [-v(erbose)|vv] [-q(uiet)] [-pages selectedPages] [-upw userpw] [-opw ownerpw] inFile [outFile]
pdfcpu stamp update [-v(erbose)|vv] [-q(uiet)] [-pages selectedPages] [-upw userpw] [-opw ownerpw] -mode text|image|pdf string|file description inFile [outFile]

pdfcpu watermark add    [-v(erbose)|vv] [-q(uiet)] [-pages selectedPages] [-upw userpw] [-opw ownerpw] -mode text|image|pdf string|file description inFile [outFile]
pdfcpu watermark remove [-v(erbose)|vv] [-q(uiet)] [-pages selectedPages] [-upw userpw] [-opw ownerpw] inFile [outFile]
pdfcpu watermark update [-v(erbose)|vv] [-q(uiet)] [-pages selectedPages] [-upw userpw] [-opw ownerpw] -mode text|image|pdf string|file description inFile [outFile]

The mode flag is now required to set one of three supported watermark types: text|image|pdf
A corresponding new argument holds a string or an image or pdf file name. As of this release description is a required configuration string for options only.

Please update your scripts accordingly!

The api was improved for PDF Context manipulation during backend processing. The recommended pattern is:

  1. Get a pdf.Context: func ReadContextFile(inFile string) (*pdf.Context, error)
  2. Manipulate the context
  3. Write the pdf.Context: func WriteContextFile(ctx *pdf.Context, outFile string) error

Changelog

1e3294b Update README.md, travis & bump version
d1e947c Fix #117
d1472e1 Add cmd: pdfcpu fonts
862d9ee Fix #113
ee90fab Fix #114
c961839 Fix #119
9575f75 Add Dmitry Harnitski as contributor
ac888fe Fix Color Lookup for Flat encoded image (#130)
dc388b8 Add Mateusz Burniak as contributor
8519366 feat: Introduce function PageCountFile (#123)
6a45354 Add minenok-tutu as contributor
110892a Merge in PR
edeb2bd constant export (#121)
c97ac72 Fix relaxed Outline dict validation
ccc83ac Update README.md
27d554f Fix usage of parms in watermark examples .
8c9e503 Fix examples.

Assets 7
You can’t perform that action at this time.