

MemoryStream stream = new MemoryStream () document. DrawString ( "Encrypted with RC4 128bit", font, brush, new PointF ( 0, 40 )) //Save the PDF document to stream. UserPassword = "password" //Draw the text. Security //Specifies key size and encryption algorithm. PdfStandardFont font = new PdfStandardFont ( PdfFontFamily. Add () //Create PDF graphics for the page. PdfDocument document = new PdfDocument () //Add a page to the document. return File ( stream, contentType, fileName ) string fileName = "Output.pdf" //Creates a FileContentResult object by using the file contents, content type, and file name. string contentType = "application/pdf" //Define the file name. Close ( true ) //Defining the ContentType for pdf file. DrawString ( "Encrypted with RC4 128bit", font, brush, new PointF ( 0, 40 )) //Save the document into stream. Refer to PDF/UWP section for respected code samples. Close ( true ) //Save the stream as PDF document file in local machine. SaveAsync ( stream ) //Close the document. MemoryStream stream = new MemoryStream () await document.
