title: How can i reduce the size of a pdf file generated from ssrs with .net
body: <p>I am generating a PDF file from SSRS and sending mail to the Vendor. but when the file size is bigger than the email quota size, the mail is not forwarding. I need help to compress the file to reduce the size of file. Please advice me. following is the sample code.</p>
  
  <pre><code>string FileName = "SomeFileName_" + String.Format("{0:yyyyMMddHHmmss}", DateTime.Now) + ".pdf";
  string DirPath = Server.MapPath("~/App_Files/XXXX");
  string FilePath = Path.Combine(DirPath, FileName);
  string strTargetURL = GlobalParameters.SSRSBaseUrl + "/XXXXXX/rptRDLName&amp;User_ID=" + CurrentUserData.UserId + "&amp;P_ENQUIRY_HD_ID=" + EnquiryID + "&amp;rc:LinkTarget=_blank&amp;rc:Parameters=False&amp;rs:Format=PDF&amp;rs:ClearSession=true";
  try
  {
      ReportViewer objReportViewer = new ReportViewer();
      objReportViewer.ProcessingMode = ProcessingMode.Remote;
      objReportViewer.ServerReport.ReportServerCredentials = new CustomReportCredentials(ConfigurationManager.AppSettings["ReportServerId"], ConfigurationManager.AppSettings["ReportServerPwd"], "BSM");
      objReportViewer.ServerReport.Refresh();
      SSRSWebClient client = new SSRSWebClient();
      client.DownloadFileBinary(FilePath, strTargetURL);
      if (new FileInfo(FilePath).Exists)
      {     
          //............
          //Send mail
      }
  }
  </code></pre>