Skip to content

Instantly share code, notes, and snippets.

@lazytiger
lazytiger / gist:58d04ea24ce13ed35c3258993e0607ec
Last active December 28, 2022 06:59
How to remove watermark created by spire.pdf?
PDDocument document = PDDocument.load(new File("files/test.pdf"));
for (PDPage page : document.getPages()) {
PDResources resources = page.getResources();
resources.getCOSObject().removeItem(COSName.PATTERN);
}
document.save("files/1.pdf");