// Add a page to the dummy doc.
tempDoc.PagePushBack(tempDoc.PageCreate());
st.SetAlignment(StamperHorizontalAlignment.e_horizontal_center, StamperVerticalAlignment.e_vertical_center);
// Set text color to black
st.SetFontColor(new ColorPt(0, 0, 0));
// Add a text to the dummy page. This text will be the watermark you going to apply on your original document.
st.StampText(tempDoc, text, new PageSet(1, tempDoc.GetPageCount()));
// Reduce PDF page to minimal size
tempDoc.GetPage(1).SetMediaBox(tempDoc.GetPage(1).GetVisibleContentBox());
// Require a sepaprate license
PDFDraw draw = new PDFDraw();
// Adjust image output quality
draw.SetDPI(100);
draw.SetPageTransparent(true);
// Export the dummy page's text as an image
var pngImageData = await draw.ExportAsStreamAsync(tempDoc.GetPage(1), "PNG");
img1 = await Image.CreateAsync(pdfDoc.GetSDFDoc(), pngImageData);
}
// Create a new stamper to embed the above created image to the original doc