Skip to content
ComPDF
DemoAPI ReferenceFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub
Guides

Remove Watermark

Remove Watermarks

Use removeWatermark to remove one watermark by index.

tsx
removeWatermark(index: number): Promise<boolean>;

const success = await pdfReaderRef.current?._pdfDocument.removeWatermark(0);
console.log("Remove watermark result:", success);

Use removeAllWatermarks to remove all watermarks from the current document.

tsx
removeAllWatermarks(): Promise<boolean>;

const success = await pdfReaderRef.current?._pdfDocument.removeAllWatermarks();
console.log("Remove all watermarks result:", success);

Notes

  • removeAllWatermarks removes all watermarks from the current document.
  • removeAllWatermarks returns true when the operation succeeds and false when the native platform does not complete the operation.
  • Watermark changes modify the in-memory document. To persist the changes, call save or saveAs according to your document workflow.