Itextsharp is quite retarded in modifying PDF files.
Private void button3_click (Object sender, system. eventargs E)
{
Pdfreader reader = new pdfreader (@ "4.pdf ");
Int n = reader. numberofpages;
Pdfstamper stamp = new pdfstamper (reader, new filestream ("test1watermark.pdf", filemode. Create ));
Int I = 0;
Specified contentbyte under;
Itextsharp. Text. Image IMG = image. getinstance ("jpg.jpg ");
IMG. setabsoluteposition (516,823 );
IMG. scaleabsolute (100,100 );
Image Mm = image. getinstance ("mm.jpg ");
Mm. setabsoluteposition (500,810 );
Mm. scaleabsolute (300,100 );
While (I <n)
{
I ++;
// Under = stamp. getundercontent (I );
Under = stamp. getovercontent (I );
Under.
// Under. roundrectangle (100,100,100,100,100 );
Template template = under. createtemplate (300,300 );
Under. addimage (IMG );
Under. addimage (mm );
Template. addimage (IMG );
Under. addtemplate (template, 200,400 );
}
Stamp. Close ();
Reader. Close ();
}