![]() ![]() Load the existing PDF document FileStream docStream = new FileStream (, FileMode. The following code example explains how to redact the information from a page by drawing mosaic pattern on the redacted area using appearance. You can draw the different patterns on the redacted area using the Appearance property in the PdfRedaction class. You can download a complete working sample from GitHub. Add ( redaction ) 'Save and close the PDF document document. DrawImage ( image, New RectangleF ( 0, 0, 182, 157 )) 'Draw image on the redacted bounds page. Pages ( 0 ), PdfLoadedPage ) 'Create PDF redaction for the page Dim redaction As PdfRedaction = New PdfRedaction ( New RectangleF ( 63, 57, 182, 157 )) 'Draw image on the redacted bounds Dim image As PdfImage = New PdfBitmap ( "Image.png" ) redaction. 'Load a PDF document Dim document As PdfLoadedDocument = New PdfLoadedDocument ( "Input.pdf" ) 'Get first page from the document Dim page As PdfLoadedPage = Tr圜ast ( document. The following code example explains how to redact the information from a page by drawing image on the redacted area using appearance. You can draw the image on the redacted area using the Appearance property in PdfRedaction class. Red, New PointF ( 5, 5 )) 'Adds redaction to the loaded page page. DrawString ( "Redacted", font, PdfBrushes. Courier, 10 ) 'Draw text on the redacted area redaction. Pages ( 0 ), PdfLoadedPage ) 'Create PDF redaction for the page Dim redaction As PdfRedaction = New PdfRedaction ( New RectangleF ( 343, 147, 60, 17 )) 'Font for the overlay text Dim font As PdfStandardFont = New PdfStandardFont ( PdfFontFamily. Save ( stream ) //Close the document document. Redact () //Creating the stream object MemoryStream stream = new MemoryStream () //Save the document document. AddRedaction ( redaction ) //Redact the contents from the PDF document document. Red, new PointF ( 5, 5 )) //Add a redaction object into the redaction collection of loaded page page. Courier, 10 ) //Draw text on the redacted area redaction. Black ) //Font for the overlay text PdfStandardFont font = new PdfStandardFont ( PdfFontFamily. Pages as PdfLoadedPage //Create a redaction object PdfRedaction redaction = new PdfRedaction ( new RectangleF ( 343, 167, 100, 25 ), Color. Read ) PdfLoadedDocument document = new PdfLoadedDocument ( docStream ) //Get the first page from the document PdfLoadedPage page = document. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |