Changelog History
Page 1
-
v0.3.7 Changes
November 04, 2020π This release introduces basic support for CJKV and multi plane Unicode fonts in general.
In order to produce stamps/watermarks using your favorite TrueType font you need to install it as a user font:
Go-> pdfcpu font install SimSun.ttf installing to /Users/horstrutter/Library/Application Support/pdfcpu/fonts... SimSun
π Supported are also TrueType collections:
Go-> pdfcpu font install Songti.ttc installing to /Users/horstrutter/Library/Application Support/pdfcpu/fonts... STSongti-SC-Black STSongti-SC-Bold STSongti-TC-Bold STSongti-SC-Light STSong STSongti-TC-Light STSongti-SC-Regular STSongti-TC-Regular
The following command lists all fonts available:
Go-> pdfcpu font list Corefonts: Courier Courier-Bold Courier-BoldOblique Courier-Oblique Helvetica Helvetica-Bold Helvetica-BoldOblique Helvetica-Oblique Symbol Times-Bold Times-BoldItalic Times-Italic Times-Roman ZapfDingbats Userfonts(/Users/horstrutter/Library/Application Support/pdfcpu/fonts): STSong (43033 glyphs) STSongti-SC-Black (8535 glyphs) STSongti-SC-Bold (43033 glyphs) STSongti-SC-Light (43033 glyphs) STSongti-SC-Regular (43033 glyphs) STSongti-TC-Bold (43033 glyphs) STSongti-TC-Light (43033 glyphs) STSongti-TC-Regular (43033 glyphs) SimSun (22141 glyphs)
Now you are ready to stamp your file:
Go-> pdfcpu stamp add -mode text "θΏζ―δΈδΈͺζ΅θ―" "fo:SimSun" in.pdf out.pdf writing out.pdf... pages: all
There is also a command for producing font cheat sheets.
pdfcpu will produce a single-page PDF for each Unicode plane covered in the current dir:Go-> pdfcpu font cheat SimSun creating cheatsheets for: SimSun Go-> lsd Sim* -rw-r--r--@ 1 horstrutter staff 5.9M Oct 27 22:31 SimSun_BMP.pdf
Open issues:
- right to left languages
- horizontal vs. vertical glyph selection
- π support for *.otf files using CFF
Thank you everybody for filing issues and PRs.
π You are a big help in making pdfcpu even better
π± Happy coding ππ Changelog
β be6f998 Add CJVK font tests
89ecdcd Add Henrik ReinstΓ€dtler to contributors
π 7a03716 Add config.yml parsing for wasm
3447d04 Add font cheatsheet cmd
π be1af10 Add support for TrueType collections
π 5c15907 Add support for Type0 fonts
718a3f0 Bump version
π 15cec79 Correct position of build tag in parseConfig.go
63d5b3d Fix #233
0abfbc1 Fix conversion points to inches.
β adad3e0 Fix font test
π 478c2c9 Merge branch 'cjkv' into master
π 070b2d4 Remove not needed build tag in parseConfig_js.go
9c1b20f fix panic on zero index -
v0.3.6 Changes
September 29, 2020Hello!
The focus of this release is the pdfcpu config dir.
π§ This dir containsconfig.yml
which represents the current default configuration.
config.yml
will be loaded on restarting pdfcpu either via the API or the CLI.You can find out about the location of the config dir via
pdfcpu version -v
π Since there seem to be usecases where it makes sense to bypass the config dir
you can pass the new flag-config disable
into any call executed on the cmd line
and in your Go backend you may callapi.DisableConfigDir()
to achieve the same.
Just a friendly reminder that in such a scenario user fonts (possibly for stamping) are not available.You can also pass a custom path to an existing directory like in
config /User/pdf
and pdfcpu will create apdfcpu
config dir within. Like this you can manage multiple config dirs.
Just make sure you pass the corresponding config dir you'd like to use before your pdfcpu operation.. βββ config.yml βββ fonts βββ Geneva.gob βββ OldTypewriter.gob βββ Roboto-Regular.gob
The config dir also contains a dir called
fonts
which is the home for user fonts installed via eg.pdfcpu fonts install abc.ttf
π More about this in the next release which will be all about fonts.Thank you all for reporting bugs and filing issues.
π± Stay tuned and happy coding ππ Changelog
β 67f0c34 Add low level test for collect
β e77e4e4 Add low level test for split
4f10ad0 Fix #218
9328d3b Fix #220
7a20978 Fix #221
f5a85ae Fix #222
113adaf Fix #223
4c18535 Fix #224
6b2e3b4 Fix #231, #232, bump version
d8572c7 Fix attachment literal creations
218a002 Handle config dir & introduce config.yml -
v0.3.5 Changes
August 30, 2020π This is a bug fix release mostly.
π The api is being extended step by step to support working with io.Readers across the board. For example this release contains all necessary changes and additions for attachment processing and extraction of images, fonts, pages, content and metadata.
Check out:
β api/test/attachments_test.go:
β func TestAttachmentsLowLevel(t *testing.T)β api/test/extract_test.go:
β func TestExtractImagesLowLevel(t *testing.T)
β func TestExtractFontsLowLevel(t *testing.T)
β func TestExtractPagesLowLevel(t *testing.T)
β func TestExtractContentLowLevel(t *testing.T)
π func TestExtractMetadataLowLevel(t *testing.T)π± Thank you all for taking the time and filing issues π
π Changelog
π 27a1239 Add io.Reader support to attachment processing
e408740 Add jozuenoon and joonas-fi as contributors
ec0e42a Fix #100
6faa4ad Fix #145, bump version
a9ba4ec Fix #213
be1e0eb Fix #215
71b1f67 Fix validation for a few corner cases
ef81799 Handle non *os.File buffers. (Fix #207) (#208)
c336114 Ignore illegal previous xref table section offset.
π¨ 0d377dd Refactor api/cli file structure.
β‘οΈ 252fc8d Update dependencies
5bece43 wip -
v0.3.4 Changes
June 28, 2020Hello!
π We are rolling out another bugfix release.
An api extension also makes it easier for you to watermark PDFs from your backend.
π§ As usually you may pass in anil *pdfcpu.Configuration
and pdfcpu will lazily use a default configuration
π¦ thereby decoupling you from thepdfcpu
package:func AddTextWatermarksFile(inFile, outFile string, selectedPages []string, onTop bool, text, desc string, conf *pdfcpu.Configuration) error func AddImageWatermarksFile(inFile, outFile string, selectedPages []string, onTop bool, fileName, desc string, conf *pdfcpu.Configuration) error func AddPDFWatermarksFile(inFile, outFile string, selectedPages []string, onTop bool, fileName, desc string, conf *pdfcpu.Configuration) error func UpdateTextWatermarksFile(inFile, outFile string, selectedPages []string, onTop bool, text, desc string, conf *pdfcpu.Configuration) error func UpdateImageWatermarksFile(inFile, outFile string, selectedPages []string, onTop bool, fileName, desc string, conf *pdfcpu.Configuration) error func UpdatePDFWatermarksFile(inFile, outFile string, selectedPages []string, onTop bool, fileName, desc string, conf *pdfcpu.Configuration)
π If you want to use ReadSeekers and Writers you may use the following helpers to configure your watermark:
func TextWatermark(text, desc string, onTop, update bool) (*pdfcpu.Watermark, error) func ImageWatermark(fileName, desc string, onTop, update bool) (*pdfcpu.Watermark, error) func PDFWatermark(fileName, desc string, onTop, update bool) (*pdfcpu.Watermark, error)
There is also a way now to get the permission bits of a PDF file:
func GetPermissionsFile(inFile string, conf *pdf.Configuration) (*int16, error)
You may also now change a PDFs title, author or subject using the
properties
command:pdfcpu properties add 'Title = My title' pdfcpu properties add 'Author = Me' pdfcpu properties add 'Subject = My subject' pdfcpu properties add 'Title = My title' 'Subject = My subject' 'Author = Me'
Thanks everybody for taking the time and filing issues for discovered bugs!
π± You all π are a big help in making pdfcpu a great tool.π± Happy coding π
π Changelog
2ee5072 Bump version
0e49c13 Fix #196
0f48029 Fix #191
13bc9a0 Fix #197
7cf00c8 Fix #201, #202
1f68247 Fix #100, #199
d8b8be9 Fix #177
43b3751 Add minusworld as contributor.
π 9250952 Merge pull request #200 from minusworld/patch-1
β 66fb319 Fix test that was matching the same variable.
β‘οΈ b0be069 Update funding.yml
e8c64ce Fix #102
78ce79a Fix #180
a9145ce Create FUNDING.yml
f1b22f1 Fix #195
85288be Fix #187
a9c1f4d Fix #194
43b72c3 Fix #193
58a1e27 Fix #174
ed59dc3 Fix #192 -
v0.3.3 Changes
May 25, 2020π This is a maintenance release featuring a couple of extensions for text based watermarking/stamping.
Have a look at some examples.
π The documentation of said features will be available on pdfcpu.io shortly.π± Happy coding & Thank you for using pdfcpu π
π Changelog
195cc73 Add Carlos Eduardo Witte as contributor
9184889 Extend watermarking
π 2396969 Fix #149, Add cmd prefix support to help
6d5c8c0 Fix #153
3ccfa0f Fix #155
f3a25d9 Fix #156
4a9adac Fix #157, bump version
760a5aa Fix #159
b2e52e8 Fix #160
215fc52 Fix #164
4c0473c Fix #166
a7901a1 Fix #170,#173,#175
6220ebf Fix #181,#182
abe118f Fix #183, #184
4b5cc24 Fix #188
33e7eff Fix add keywords
ba4e619 Fix coverage.sh
π cc558fe Fixed ToMillimetres() (#162)
π 198349c Fixed a bug in paperSize.go toMillimetres, which was returning d.Height twice instead of d.Width and d.Height; and fixed ToMillimeters and ToCentimeters spelling errors.
π bfe4c05 Fixed func toMillimetres() which was returning d.Height twice instead of d.Width and d.Height
βͺ 1ff4f53 Revert "Fixed a bug in paperSize.go toMillimetres, which was returning d.Height twice instead of d.Width and d.Height; and fixed ToMillimeters and ToCentimeters spelling errors." -
v0.3.2 Changes
January 04, 2020Hello!
π This release is packed with a couple of new features:
Multi-Stamping
This is an enhancement to pdfcpu's PDF stamp command.
From now on when adding a PDF stamp and no specific stamp page is defined pdfcpu will apply each page of the stamp.pdf one-by-one to the input file and after that it repeatedly uses the last page of stamp.pdf if the input file has more pages. This will allow you to apply corporate designs to your PDFs in one simple step like so:
pdfcpu stamp add -mode pdf stamp.pdf 'rot:0, pos:bl, scale: 1.0 rel' in.pdf out.pdf
If you want to stamp with a specific page of stamp.pdf you need to define this like in
stamp.pdf:3
π See also #146.π The first release of 2020 also introduces four new commands:
- keywords
- properties
- portfolio
- collect
Manage search keywords
π List, add, remove document keywords.
Keywords are also part ofpdfcpu info
.
Please also refer topdfcpu help keywords
.usage: pdfcpu keywords list [-v(erbose)|vv] [-q(uiet)] [-upw userpw] [-opw ownerpw] inFile pdfcpu keywords add [-v(erbose)|vv] [-q(uiet)] [-upw userpw] [-opw ownerpw] inFile keyword... pdfcpu keywords remove [-v(erbose)|vv] [-q(uiet)] [-upw userpw] [-opw ownerpw] inFile [keyword...]
Manage document properties
π List, add, remove document properties.
Properties are also part ofpdfcpu info
.
Please also refer topdfcpu help properties
.usage: pdfcpu properties list [-v(erbose)|vv] [-q(uiet)] [-upw userpw] [-opw ownerpw] inFile pdfcpu properties add [-v(erbose)|vv] [-q(uiet)] [-upw userpw] [-opw ownerpw] inFile keyValuePair... pdfcpu properties remove [-v(erbose)|vv] [-q(uiet)] [-upw userpw] [-opw ownerpw] inFile [key...]
Portfolio
π List, add, remove, extract portfolio entries.
pdfcpu attachment
remains the command for managing plain attachments, whereaspdfcpu portfolio
manages portfolio entries that will presented as such by Adobe Reader.
In a nutshell the behavior of this command reflects the oldattachment
command.
Please also refer topdfcpu help portfolio
.
π See also #112.usage: pdfcpu portfolio list [-v(erbose)|vv] [-q(uiet)] [-upw userpw] [-opw ownerpw] inFile pdfcpu portfolio add [-v(erbose)|vv] [-q(uiet)] [-upw userpw] [-opw ownerpw] inFile file[,desc]... pdfcpu portfolio remove [-v(erbose)|vv] [-q(uiet)] [-upw userpw] [-opw ownerpw] inFile [file...] pdfcpu portfolio extract [-v(erbose)|vv] [-q(uiet)] [-upw userpw] [-opw ownerpw] inFile outDir [file...]
Collect
Create a custom PDF page sequence.
Pages may appear multiple times in any way you prefer:
pdfcpu collect -pages 5,1-3,1-3 in.pdf out.pdf
Please also refer topdfcpu help collect
.usage: pdfcpu collect [-v(erbose)|vv] [-q(uiet)] -pages selectedPages [-upw userpw] [-opw ownerpw] inFile [outFile]
There is also an important change to the insert page command:
β¨ Enhanced insert page command
0οΈβ£
pdfcpu pages insert
now featuresmode before|after
.mode
defaults tobefore
.
This will allow you to insert pages at the end of your document:
βpdfcpu pages insert -mode after -pages l test.pdf
πl
... last page. See also #140,#148π Like always there are also a couple of bug fixes.
Thank you so much for using pdfcpu!
π± Have fun! ππ Changelog
055056b Add collect cmd
683591d Add new cmds: keywords, properties
789c1fd Fix #112
990136b Fix #140
71c52af Fix #143
9f62b17 Fix #144
eb8f480 Fix #146
df75777 Fix #148
623e0df Fix #152
β‘οΈ 3a5e89f Update README.md -
v0.3.1 Changes
December 09, 2019π This release introduces TrueType font support for stamps/watermarks.
- π Use
pdfcpu fonts install
to install a list of ttf fonts. (pdfcpu f i
also works) - π¨ Use
pdfcpu fonts list
to print the list of supported/installed fonts. (pdfcpu f l
also works) - β
Run
TestCreateFontSamples
in api_test.go anytime to produce sample pages for all installed fonts.
π We are also introducing a pdfcpu config dir with this release using the os.UserConfigDir introduced with go 1.13. hence we also had to bump the required minimum version for building to go1.13.
π³ We finally also have a docker file and a couple of bugs have been fixed.
π Thanks to everybody contributing to this release be it by submitting issues or PRs! π
π Changelog
β‘οΈ 6440804 Update min go version to 1.13
23dcd69 Add Sam Giffney as contributor
π c4192ba Add TrueType font support
π³ 9927baa Merge pull request #139 from s01ipsist/dockerize
π³ 06aa5e8 Add Dockerfile and usage instructions
c20cd91 Fix #137
7519e68 Fix #138
8d41ed1 Fix #133
41b9a79 Add ryarnyah as contributor
π 9f4f093 Merge pull request #131 from ryarnyah/fix/go-fuzz-read
f99a631 Add Invalid filter to NewFilter to fix crash found with go-fuzz
e7fdde8 Fix #126 - π Use
-
v0.3 Changes
November 15, 2019π Another watermark focused release comes with full support for the Adobe standard/core fontset.
π¨ The newpdfcpu 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 releasedescription
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:
- Get a pdf.Context:
func ReadContextFile(inFile string) (*pdf.Context, error)
- Manipulate the context
- 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. - Get a pdf.Context:
-
v0.2.5 Changes
September 23, 2019π Changelog
π Focus of this release is enhanced stamping & watermarking.
β‘οΈ Finally pdfcpu is able to add, update and remove stamps & watermarks for selected pages.
Go to here and scroll all the way down for examples of a typical stamp lifecycle.Stamps and watermarks are conceptually the same with the distinction that
watermarks are rendered before the page content whereas stamps get rendered after the page content.What applies to stamping applies to watermarking as well.
π Starting with this release in the realm of pdfcpu:- β A page stamp is the result of repeatedly Adding stamps to an individual page.
- β‘οΈ Updating the stamp for a selected page will replace this page stamp.
- Removing a stamp for an individual page removes the page stamp.
Unfortunately there have been changes to the CLI for the sake of consistency:
pdfcpu stamp add [-v(erbose)|vv] [-q(uiet)] [-pages selectedPages] [-upw userpw] [-opw ownerpw] 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] description inFile [outFile]
β‘οΈ Please update your scripts for adding stamps & watermarks accordingly and as a reminder:
pdfcpu is still Alpha!π The command config parameter parser supports prefixes now,
Just make sure you supply enough characters to for a unique prefix that can be identified.
Eg.o: .5
is ambiguous because there isopacity
andoffset
butop: 0.5
oroff: 0 15
will work.You can also now position individual stamps which enables more complex page stamps/watermarks.
β‘οΈ Until pdfcpu.io is updated please refer topdfcpu help stamp
andpdfcpu help watermark
.π
pdfcpu import
is now optionally supporting a desired destination resolution via thedpi
command description string parameter. Please refer topdfcpu help import
for more.98e24ae Add api.PageDims
5b4caaf Ensure correct PDF version before writing.
4d4296a Fix #101, #103, #104, #107, #108, #109
954206e Make LastModified optional rather than required in validatePieceDict (#106)
β‘οΈ 87915e4 Update contributors in README.md -
v0.2.4 Changes
August 27, 2019pdfcpu info
also displays pagesize(s) in points now . Use-u
to set units to inch, cm or mm.api.PageDims(inFile string)
returns a slice of page dimensions.- π¦
pdfcpu/ccitt
is removed as pdfcpu starts using the newx/image/ccitt
package. pdfcpu/lzw
andpdfcpu/tiff
are outsourced tohhrutter/lzw
andhhrutter/tiff
π Changelog
73a6312 Fix #100
2943473 Fix #104
π f49dee9 Minor fixes.
π fc3b384 Move lzw and tiff into separate repos