My Source Page has the following tag
<eo:ASPXToPDF ID="ASPXToPDF1" runat="server" OnAfterRender="ASPXToPDF1_AfterRender" OnBeforeRender="ASPXToPDF1_BeforeRender"></eo:ASPXToPDF>
protected void Page_Load(object sender, EventArgs e)
{
.....
....
ASPXToPDF1.RenderAsPDF(filename);
}
protected void ASPXToPDF1_BeforeRender(object sender, EventArgs e)
{
}
protected void ASPXToPDF1_AfterRender(object sender, EventArgs e)
{
//Cast the Result property to HtmlToPdfResult
HtmlToPdfResult result = (HtmlToPdfResult)ASPXToPDF1.Result;
foreach (PdfPage page in doc.Pages)
{
int i;
float xPos = 200;
float yPos = 430;
EO.Pdf.Contents.PdfTextLayer textLayer = new EO.Pdf.Contents.PdfTextLayer();
textLayer.Font = new EO.Pdf.Drawing.PdfFont("Castellar", 35);
textLayer.NonStrokingColor = System.Drawing.Color.LightGray;
EO.Pdf.Contents.PdfTextContent textContent = new EO.Pdf.Contents.PdfTextContent(PDFReportConstants.WaterMarkText);
//textContent.PositionMode = EO.Pdf.Contents.PdfTextPositionMode.Offset;
//textContent.Offset = new EO.Pdf.Drawing.PdfPoint(xPos, yPos);
textLayer.GfxMatrix.Translate(xPos, yPos);
textLayer.GfxMatrix.Rotate(45);
//Add the text object into the text layer object
textLayer.Contents.Add(textContent);
//Add the text layer into the page
page.Contents.Add(textLayer);
}
}
Since am using AfterRender its adding the watermark text on the Generated PDF its not transparent . I referred the following link
http://www.essentialobjects.com/doc/4/web/aspxtopdf.aspx#debugbut i cant add the code in BeforeRender since the page will have no data.
The page Rendered Has too many textboxes,grids and charts so i am not comfortable using HtmlToPdf
,is there a way by which i can use the existing output ??
Like now i have the resulting pdf as 'OUTPUTPDF' .I can create another pdf with just watermark say WATERMARKPDF. Can we add the OUTPUTPDF content on WATERMARKPDF??
OR
is there any other way of doing the same using ASPXToPDF, Because we have got the license for EO PDF 2013
Thanks & Regards
Guna