title: How to make pdf read only in itext
body: <p>My code follows</p>
  
  <pre><code>public static void main(String[] args) {
          try 
          {
              PdfReader reader = new PdfReader("D:\\SF_Users.pdf");
              int n = reader.getNumberOfPages();
              Rectangle psize = reader.getPageSize(1);
              Document document = new Document(psize);
              PdfWriter writer = PdfWriter.getInstance(document,
                      new FileOutputStream("D:\\new.pdf"));
              document.open();
              PdfContentByte pdf = writer.getDirectContent();
              document.newPage();
              PdfImportedPage page = writer.getImportedPage(reader, 1);
              pdf.addTemplate(page, .5f, 0, 0, .5f, 60, 120);
              document.close();
          } catch (Exception de) {
          }
      }
  </code></pre>
  
  <p>Here i can able to read pdf while writting i want make it read only </p>
  
  <p>Thank You</p>