Add Text Watermark
ComPDFKit React Native SDK supports adding text watermarks through a UI dialog. You can configure default watermark styles (such as text, color, and font size) in CPDFConfiguration.
tsx
// Set default text watermark style in configuration
ComPDFKit.getDefaultConfig({
global: {
watermark: {
types: ['text', 'image'],
text: 'ComPDFKit-RN',
textColor: '#000000',
textSize: 36,
rotation: -45,
opacity: 255,
}
}
})
// Open the add watermark dialog via API
await pdfReaderRef.current?.showAddWatermarkView({
types: ['text', 'image'],
text: 'ComPDFKit RN',
textColor: '#000000',
textSize: 36,
rotation: -45,
opacity: 255,
});