How Do I Change the Font Color of textAnnotations?
Author: joelmastersCreated Jul 4, 2020Updated Jul 22, 2026
Question
Description
Hello. How do I change the font color of textAnnotations? The color property changes the background/fill color of the bounding rectangle.
Code sample
For example:
doc.textAnnotation(50, 50, 100, 20, 'test text', { color: 'red' });
Will create a textAnnotation with red fill and black text. How can I change the color of the text to something other than black?
Thank you!
Your environment
- pdfkit version: 0.11.0
- Node version: 13.7.0
- Browser version (if applicable):
- Operating System: macOS 10.13.6
Source: foliojs/pdfkit