Usuário com melhor resposta
Bloquear o shift+ctrl+S

Pergunta
-
Bom dia amigos.
Estou desenvolvendo um aplicação winforms (VS 2005, .net 2.0) que irá fazer leitura de pdfs. Estou usando o pdfsharp.
O Leitor está funcionando blz. Mas eu preciso bloquear a copia e impresão desse pdf. e ai gostaria de desativar esses recursos como tbm suas teclas de atalho.
shift+ctrl+s
ctrl +p
No aguardo.
att
Respostas
-
Amigo vc encontra no próprio site:
http://www.pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=36&Itemid=47
Espero ter ajudado.
This sample shows how to protect a document with a password.
// Get a fresh copy of the sample PDF file string filename = "HelloWorld.pdf"; File.Copy(Path.Combine("../../../../PDFs/", filename), Path.Combine(Directory.GetCurrentDirectory(), filename), true); // Open an existing document. Providing an unrequired password is ignored. PdfDocument document = PdfReader.Open(filename, "some text"); PdfSecuritySettings securitySettings = document.SecuritySettings; // Setting one of the passwords automatically sets the security level to // PdfDocumentSecurityLevel.Encrypted128Bit. securitySettings.UserPassword = "user"; securitySettings.OwnerPassword = "owner"; // Don´t use 40 bit encryption unless needed for compatibility reasons //securitySettings.DocumentSecurityLevel = PdfDocumentSecurityLevel.Encrypted40Bit; // Restrict some rights. securitySettings.PermitAccessibilityExtractContent = false; securitySettings.PermitAnnotations = false; securitySettings.PermitAssembleDocument = false; securitySettings.PermitExtractContent = false; securitySettings.PermitFormsFill = true; securitySettings.PermitFullQualityPrint = false; securitySettings.PermitModifyDocument = true; securitySettings.PermitPrint = false; // Save the document... document.Save(filename); // ...and start a viewer. Process.Start(filename);
Todas as Respostas
-
Amigo vc encontra no próprio site:
http://www.pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=36&Itemid=47
Espero ter ajudado.
This sample shows how to protect a document with a password.
// Get a fresh copy of the sample PDF file string filename = "HelloWorld.pdf"; File.Copy(Path.Combine("../../../../PDFs/", filename), Path.Combine(Directory.GetCurrentDirectory(), filename), true); // Open an existing document. Providing an unrequired password is ignored. PdfDocument document = PdfReader.Open(filename, "some text"); PdfSecuritySettings securitySettings = document.SecuritySettings; // Setting one of the passwords automatically sets the security level to // PdfDocumentSecurityLevel.Encrypted128Bit. securitySettings.UserPassword = "user"; securitySettings.OwnerPassword = "owner"; // Don´t use 40 bit encryption unless needed for compatibility reasons //securitySettings.DocumentSecurityLevel = PdfDocumentSecurityLevel.Encrypted40Bit; // Restrict some rights. securitySettings.PermitAccessibilityExtractContent = false; securitySettings.PermitAnnotations = false; securitySettings.PermitAssembleDocument = false; securitySettings.PermitExtractContent = false; securitySettings.PermitFormsFill = true; securitySettings.PermitFullQualityPrint = false; securitySettings.PermitModifyDocument = true; securitySettings.PermitPrint = false; // Save the document... document.Save(filename); // ...and start a viewer. Process.Start(filename);
-
Obrigado Laercio da Silva Freitas
Irei testar essa parte da biblioteca. Assim que tiver um resultado informo aqui no Forum..
Abraços,
-
-