title: Change Settings of a PDF document with PDFSharp
body: <p>What I want to do is to send a PDF Document to a user and restrict him to do anything other than to scroll and zoom within the document. Especially the print option should be disabled. I tried it with the following VB.NET Code, creating a new PDF file:</p>
  
  <pre><code>Imports PdfSharp.Drawing
  Dim document As New PdfSharp.Pdf.PdfDocument
  
      document.Info.Title = "Built with PDFSharp"
      document.Info.CreationDate = Now
      document.Info.Subject = "PDFSharp Test"
  
      Dim page As PdfSharp.Pdf.PdfPage = document.AddPage
  
      Dim gfx As XGraphics = XGraphics.FromPdfPage(page)
      Dim font As PdfSharp.Drawing.XFont = New PdfSharp.Drawing.XFont("Verdana", 20, PdfSharp.Drawing.XFontStyle.Bold)
      gfx.DrawString("Hello, World!", font, XBrushes.Black, New XRect(0, 0, page.Width, page.Height), XStringFormats.Center)
  
      document.SecuritySettings.PermitFullQualityPrint = False
      document.SecuritySettings.PermitPrint = False
      document.SecuritySettings.PermitAccessibilityExtractContent = False
      document.SecuritySettings.PermitAnnotations = False
      document.SecuritySettings.PermitAssembleDocument = False
      document.SecuritySettings.PermitExtractContent = False
      document.SecuritySettings.PermitFormsFill = False
      document.SecuritySettings.PermitModifyDocument = False
  
      ' Save the file
      Dim filename As String = "HelloWorld.pdf"
      document.Save(filename)
  </code></pre>
  
  <p>But when the PDF document is opened, there still is the possibility to print and to do other things, like it is in normal PDF documents. Am I missunderstanding the <em>securitySettings</em>? I view the PDF document with adobe acrobot. Any help is appreciated.</p>