I need to remove the graphics from a page in the PDF.
I started by drawing a line and then trying to remove it, using the Restore() function but it didn't work, I used the following code:
PdfLoadedDocument lDoc = new PdfLoadedDocument(stream);
PdfGraphics graphics = lDoc.Pages[0].Graphics;
PdfGraphicsState state = graphics.Save();
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 14, PdfFontStyle.Bold);
graphics.DrawString("New page - Test", font, PdfBrushes.Red, new System.Drawing.PointF(200, 10));
PdfViewer.LoadDocument(lDoc);
and to delete the graphics:
graphics.Restore(state);
What should I do to remove the graphics ?