/* * This code is free software. It may only be copied or modified * if you include the following copyright notice: * * --> Copyright 2001 by Bruno Lowagie <-- * --> Copyright 2004 by Kazuya Ujihara <-- * * This code is example code of 'iText .NET'. * See http://www.ujihara.jp/iTextdotNET/examples.html * * This code is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ using System; using com.lowagie.text; using com.lowagie.text.pdf; using System.IO; public class Chap0109 { public static void Main(string[] args) { Console.WriteLine("Chapter 1 example 9: encryption 40 bits"); Document document = new Document(PageSize.A4, 50, 50, 50, 50); PdfWriter writer = PdfWriter.getInstance(document, new FileStream("Chap0109.pdf", FileMode.Create)); writer.setEncryption(PdfWriter.STRENGTH40BITS, null, null, PdfWriter.AllowCopy); document.open(); document.add(new Paragraph("This document is Top Secret!")); document.close(); } }