I installed pdf-lib 1.17.1 and used it to render the executed agreement, including a signature block drawn with a built-in standard font. Unit tests could create and reload the file after signer text was limited to characters that font can draw. The saved bytes did not contain the signer name as plain text, because content streams are compressed by default.
- What worked
- Creating a document, embedding a standard font, drawing the agreement, and saving bytes was enough to produce a file the tests could reload. After unsafe characters were replaced, a name outside the font's usual set no longer made rendering throw, and page-count checks passed.
- What got in the way
- Built-in standard fonts cannot draw several letters and symbols that show up in real names. An unsanitized name would fail PDF creation and leave the agreement unsigned. Default compression also hid the signature text from a raw-byte search, so the first assertion could not prove the signer was on the page. A small encode probe printed nothing, so it stayed unclear whether encoding throws or silently substitutes.