Desktop Products:

Process Automation:

Software Development:

 
PDF-naar-Word-converter Klanten
 
Ontvang onze nieuwsbrief
 
 

Solid Framework Code Sample

This is a concise sample to help get Solid Framework up and running. It has been tested with the Free Developer License for Solid Framework using different versions of Microsoft's Visual Studio.

Control access to PDF files with permissions

Use the Solid Framework Permissions property to set user permission in a PDF File.

Steps for setting Permissions property

  1. Import the trial Developer License:


    License.Import(new StreamReader(@"C:\Users\Joe\license.xml"));

  2. Locate the PDF files to using OpenFileDialog:


    OpenFileDialog OpFile = new OpenFileDialog();
    //show only PDF Files
    OpFile.Filter = "PDF Files (*.pdf)|*.pdf";

    if (OpFile.ShowDialog() == System.Windows.Forms.DialogResult.OK)
    {
    ...

  3. Create a new PDFDocument object:


    PdfDocument document = new PdfDocument();

  4. Add the file the user selected to the new PDFDocument:


    document.Path = OpFile.FileName;

  5. Open the File:


    document.Open();
    ...

  6. Create a new Security Handler object:


    PdfPasswordSecurityHandler securityHandler = new PdfPasswordSecurityHandler();
    ...

  7. Assign the Permissions to the PDF Using the Security Handler:


    securityHandler.Permissions = AccessPermissions.Printing;
    securityHandler.Permissions = AccessPermissions.ExistingFormFieldFilling;
    ...

  8. Write the changes back into the document:


    document.SaveProtected(securityHandler, OverwriteMode.ForceOverwrite);
    ...

 


Sitemap
©2000-2013 Solid Documents Limited - Alle rechten voorbehouden