![]() ![]() MemoryStream stream = new MemoryStream () await document. DrawString ( "This document is protected with owner password", font, brush, new PointF ( 0, 40 )) //Save the PDF document to stream. UserPassword = "password" //Draw the text. OwnerPassword = "syncfusion" //It allows printing and accessibility copy content. 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. DrawString ( "This document is protected with owner password", font, brush, New PointF ( 0, 40 )) 'Save and close the document. UserPassword = "password" 'Draw the text. OwnerPassword = "syncfusion" 'It allows printing and accessibility copy content. Security 'Specifies key size and encryption algorithm using 128 bit key in RC4 mode. Dim font As New PdfStandardFont ( PdfFontFamily. Add () 'Create PDF graphics for the page. Dim document As New PdfDocument () 'Add a page to the document. DrawString ( "This document is protected with owner password", font, brush, new PointF ( 0, 40 )) //Save and close the document. It further secures the PDF document to set a PDF Owner Password. Once the owner password is set, Acrobat will require this password to make any changes to the PDF document. Owner password: Sets PDF document restrictions, which can include printing, content copying, editing, page extracting, commenting, and more. You can protect the PDF document from printing, editing, copying with the OwnerPassword by using the following code snippet. While using both user and owner passwords, please specify different user and owner password while encrypting the PDF document for better security. You can download a complete working sample from GitHub. Please refer PDF/Xamarin section for respective code samples. The operation in Save under Xamarin varies between Windows Phone, Android and iOS platforms. Close ( true ) //Save the stream into pdf file. MemoryStream stream = new MemoryStream () document. DrawString ( "Encrypted with RC4 128bit", font, brush, new PointF ( 0, 40 )) //Save the PDF document to stream. 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. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |