Disable print and save

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v5)  /  Disable print and save

DynamicPDF CoreSuite for .NET (v5) Forum

 Feb 10 2010 11:46 AM
Hi,

Is there a way to set the properties of the PDF document so that when it is viewed in Adobe reader, the print and save features are disabled?

Thanks,

Shabnam
 Feb 10 2010 11:59 AM
Posted by a ceTe Software moderator
Hello Shabnam,

It is not possible to hide the specific items like print, save etc from menu. However you can hide the total menu bar by using the ViewerPreferences of the document object. You can refer to the ViewerPreferences on our help documentation. But if the user uses any shortcut keys to make them visible then he will get these menu items.

Thanks,
ceTe Software Support Team.
 Oct 12 2020 4:46 AM
Is there any update to this with latest version? Is it possible to disable the Save and Print button when I am doing a DrawToWeb using Merger?
 Oct 12 2020 10:30 AM
Posted by a ceTe Software moderator

Hello,

There is no option to disable the save toolbar item on the browser window. It is possible to hide the toolbar using ViewerPreferences for Document object but please note that, opening a PDF is completely handled by the browser or a PDF viewer.

You can disable printing by setting security to the Document object. You will need to set the AllowPrint Boolean property of security classes of our API to false and apply to the Document. Below is a code sample.

            Document document = new Document();
            Page page = new Page();
            document.Pages.Add(page);
            TextArea textArea = new TextArea("Test", 0, 0, 200, 30);

            textArea.Align = TextAlign.Left;
            page.Elements.Add(textArea);

            Aes256Security securityObj = new Aes256Security();
            securityObj.OwnerPassword = "owner";
            securityObj.AllowPrint = false;

            document.Security = securityObj;
            document.Draw(@"C:\Temp\MyDocument.pdf);

Please note that the Aes256Security class is available starting with version 7, so for version 6 or before, you will need to use the now deprecated HighSecurity or StandardSecurity classes.

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 4:36 PM.