v0.3.7
版本发布时间: 2020-11-04 19:59:30
pdfcpu/pdfcpu最新发布版本:v0.8.1(2024-08-31 21:13:37)
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-> ls 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
1、 checksums.txt 489B
2、 pdfcpu_0.3.7_Linux_i386.tar.xz 1.8MB
3、 pdfcpu_0.3.7_Linux_x86_64.tar.xz 1.98MB
4、 pdfcpu_0.3.7_macOS_x86_64.tar.xz 2.05MB
5、 pdfcpu_0.3.7_Windows_i386.zip 2.07MB
6、 pdfcpu_0.3.7_Windows_x86_64.zip 2.15MB