watermark in DLS

Hi..
How i can add a watermark in Flowmodel? i am converting an HTML string to PDF and i have to add a watermark image in all pdf files created. How i can do this?

Thanking,

4 Replies

BT Bhagya T Syncfusion Team August 10, 2006 02:26 PM UTC

Hi Skeeb,
Thank you for your interest in Essential PDF. A watermark image can be added to a PDF document using PDFTemplateArea. Use the following code:

//To create a stamp.
PDFTemplateArea stamp = document.Areas.Add( new SizeF( 300, 400 ) );

//Set properties to stamp.
stamp.Foreground = false;
Image img1 = Image.FromFile(@"..\..\Data\PDF.gif");

//Add a image object to stamp.
ImageShape img = stamp.Canvas.AddImage(img1);

Here is a sample for your reference:

WaterMark.zip


Please take a look and let me know if you have any other questions.

Thanks,
Bhagya.


AD Administrator Syncfusion Team August 10, 2006 05:01 PM UTC

Hi Bhagya,
thanks for your replay. But sadly that dosent serve my requirement. I have to show the image/text over the page content with some rotation. May be i am ignorant about some of the cool features of this product. can you help me please?



BT Bhagya T Syncfusion Team August 11, 2006 05:47 AM UTC

Hi Skeeb,
Yes, it is possible to show an text or image over the page content. Use the following code to set the rotation of the text:

//To create a stamp
Syncfusion.Pdf.DLS.PDFTemplateArea stamp = document.Areas.Add( new SizeF( 400, 400 ) );

//Set properties to stamp
stamp.Foreground = true;

//Add a text object to stamp
TextShape text = stamp.Canvas.AddText( "APPROVED" );
text.Transform.Rotate( -45 );

Here is a sample for your reference:

WaterMark.zip


Please take a look and let me know if you have any other concerns.

Thanks,
Bhagya.


AD Administrator Syncfusion Team August 14, 2006 08:55 AM UTC

Thanks Bhagya...
I think that will be helpful to me. Let me try your suggession.

Regards,

Loader.
Up arrow icon