pdfcpu v0.3.7 Release Notes
Release Date: 2020-11-04 // over 4 years ago-
π 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
Previous changes from v0.3.6
-
Hello!
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