I am Designing the Report Using RDLC and Viewing that Report in PDF format. Below is my code. Please help me how to add watermark in this PDF file.
ReportViewer1.ProcessingMode = ProcessingMode.Local;
LocalReport rep = ReportViewer1.LocalReport;
Warning[] warnings = null;
string[] streamids = null;
string mimeType = null;
string encoding = null;
string extension = null;
string deviceInfo =
"<deviceinfo>" +
" <outputformat>PDF" +
" <pagewidth>8.5in" +
" <pageheight>11in" +
" <margintop>0.5in" +
" <marginleft>0in" +
" <marginright>0in" +
" <marginbottom>0.5in" +
"";
byte[] bytes;
rep.ReportPath = "HR/Report/AttTrend.rdlc";
ReportDataSource dsStatus = new ReportDataSource("DataSet24_HR_Attendance_Trend_Report", "SP");
rep.DataSources.Add(dsStatus);
rep.Refresh();
bytes = rep.Render("PDF", deviceInfo, out mimeType, out encoding, out extension, out streamids, out warnings);
ShowPDF(bytes);
private void ShowPDF(byte[] bytePDF)
{
System.IO.MemoryStream ms = new System.IO.MemoryStream(bytePDF);
Response.ContentType = "Application/pdf";
Response.BinaryWrite(ms.ToArray());
Response.End();
}