Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Jul 28, 2020 11:23 am

Hello;
i use this code to view my pdf file ,how i can prevent print pdf document from (ctrl+p) keyboard

Dim pdfDoc As String = "..\..\..\..\..\..\Data\Multipage.pdf"
Me.pdfDocumentViewer1.LoadFromFile(pdfDoc)

Thank you

autographics1
 
Posts: 1
Joined: Wed Aug 01, 2018 6:21 am

Wed Jul 29, 2020 3:53 am

Hello,

Thanks for your inquiry.
By default, our Spire.PDFViewer cannot print PDF documents by pressing Ctrl+P.
Do you want to disable printing permission of the PDF document, as shown in the attached picture? If so, you can use our Spire.PDF and refer to the following code to achieve it. If this is not what you want, please provide more details to help us further investigate your issue. Thanks in advance.
Code: Select all
        Dim pdf As PdfDocument = New PdfDocument
        pdf.LoadFromFile("test.pdf")
        'Encrypt the PDF document with permission password
        'Allow to fill fields, copy content and edit content, other permissions are disabled, including printing.
        pdf.Security.Encrypt("permission", (PdfPermissionsFlags.FillFields Or PdfPermissionsFlags.CopyContent Or PdfPermissionsFlags.EditContent))
        pdf.SaveToFile("result.pdf", FileFormat.PDF)


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Tue Aug 11, 2020 6:14 am

Hello,

Hope you are doing well.
Has your issue been resolved? Any feedback will be greatly appreciated!

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.PDF