title: How to Set the margin of RDLC Report Before saving it to disc in PDF Format?
body: <p>I'm trying to save RDLC report to Disc in PDF Format using this code.</p>
  
  <pre><code>    this.RequestViewer.SetPageSettings(Utility.Generate_Window_Control.funcSetReportMargin());
          byte[] bytes = RequestViewer.LocalReport.Render(
  
              "PDF", null, out mimeType, out encoding, out filenameExtension,
              out streamids, out warnings);
  
          using (FileStream fs = new FileStream("D:\\output.pdf", FileMode.Create))
          {
  
              fs.Write(bytes, 0, bytes.Length);
          }
  </code></pre>
  
  <p>and setting the margin of report page using this function</p>
  
  <pre><code>    public static System.Drawing.Printing.PageSettings funcSetReportMargin()
     {
         System.Drawing.Printing.PageSettings pg = new System.Drawing.Printing.PageSettings();
         pg.Margins.Top = 10;
         pg.Margins.Bottom = 10;
         pg.Margins.Left = 0;
         pg.Margins.Right = 0;
         return pg;
     }
  </code></pre>
  
  <p>this function is working fine in PrintPreview but when I save it to pdf it prints blank pages. Kindly guide me how can i do it.</p>