pdfcpu v0.3.7 Release Notes

Release Date: 2020-11-04 // over 3 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...

    πŸ‘Œ Supported are also TrueType collections:

    Go-> pdfcpu font install Songti.ttc
    installing to /Users/horstrutter/Library/Application Support/pdfcpu/fonts...

    The following command lists all fonts available:

    Go-> pdfcpu font list
    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 contains config.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 call api.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 a pdfcpu 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