Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove or hide PDF layer using ABCPdf?

Is is possible to remove or hide a layer from a PDF using ABCPdf or another framework?

like image 276
Junior Developer Avatar asked Mar 14 '26 13:03

Junior Developer


1 Answers

The following C# example shows how layer 2 of page 1 can be deleted:

Doc theDoc = new Doc();
theDoc.Read("source.pdf");
int thePages = theDoc.GetInfoInt(theDoc.Root, "Pages");
int thePage = theDoc.GetInfoInt(thePages, "Page 1");
int theLayer = theDoc.GetInfoInt(thePage, "Content 2");
theDoc.Delete(theLayer);
like image 181
AffineMesh Avatar answered Mar 16 '26 13:03

AffineMesh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!