View Full Version : حذف باتن های ذخیره و پرینت در وب براوزر در هنگام نمایش pdf
  
sara_aryanfar
جمعه 20 مرداد 1391, 21:45 عصر
با سلام خدمت دوستان آیا راهی هست که ما وقتی یک فایل پی دی اف رو با وب براوزر نمایش میدیم مانع از ذخیره و پرینت اون بشیم ممنون اگر لطف کنید بفرمائید
tooraj_azizi_1035
جمعه 20 مرداد 1391, 22:11 عصر
اگه فقط یک فایل PDF خاص هست:
Secure PDF – NO Printing & NO Saving
  					 						Posted on October 11, 2011 (http://webauthoring.uidaho.edu/2011/10/11/secure-pdf-no-printing-no-saving/) 						by deehelp (http://webauthoring.uidaho.edu/author/deehelp/) 					
  					 						You can create a PDF document which doesn’t allow users to for edit or print it. This requires Adobe Acrobat Pro (http://www.adobe.com/products/acrobatpro.html). Here’s how:
 
 Open Acrobat Pro
 Under the File menu, select Create PDF > From File…
 Locate and open your document
 Under File, select Properties
 Select the Security tab
 Set Security Method to Password Security
 http://uiwebauthoring.files.wordpress.com/2012/01/pdf-secure01.png?w=640
 
 Under Permissions, check the Restrict editing and printing box
 Set a Password (this is so you can edit and print if needed)
 Set Printing and Changes options
 Uncheck Enable copy of text, images, and other content
 Leave Enable text access for screen reader devices checked
 Press OK
 http://uiwebauthoring.files.wordpress.com/2012/01/pdf-secure02.png?w=640
 
 Press OK on the third party warning alert
 Enter the password to confirm, and press OK
 Press OK on the save document warning alert
 Press OK on the Document Properties box
 Go to File > Save to save your protected PDF document
 Take note of your password if you ever want to modify the PDF
sara_aryanfar
جمعه 20 مرداد 1391, 23:02 عصر
یعنی راهی غیر از استفاده از خود برنامه آکروبات ریدر نیست؟
tooraj_azizi_1035
جمعه 20 مرداد 1391, 23:06 عصر
مگه نمی خوای فقط یه فایل بخصوص رو Secure کنی؟
sara_aryanfar
جمعه 20 مرداد 1391, 23:09 عصر
بله درسته هربار فایل مشخص هستش البته تعداد فایل ها زیاده اما هر بار یده خاص مد نظره من می خوام در محیطی مانند اکروبات ریدر باز بشه امکانات اونو داشته باشه ولی نشه سیو کرد و پرینت گرفت برا همین میام تو وب براوزر باز می کنم ولی خب این امکان سیو و پرینت دارن خب
tooraj_azizi_1035
جمعه 20 مرداد 1391, 23:13 عصر
باید با PDFsharp کار کنی:http://www.pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=36&Itemid=47
Protected Document
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);
sara_aryanfar
جمعه 20 مرداد 1391, 23:23 عصر
ممنون من فقط می خوام این دو گزینه حذف بشن و نه اینکه روی پی دی اف پسورد گذاری بشه  می تونم منظورمو برسونم؟
tooraj_azizi_1035
جمعه 20 مرداد 1391, 23:27 عصر
من این کدها رو تست نکردم ولی وقتی PermitPrint = false; وجود دارد احتمالاً دکمه پرینت حذف میشه یا اینکه حداقل کار نمی کنه.
 
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.