VintaSoft Imaging .NET SDK and Plug-ins Discussions
Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.
Board index < VintaSoft Imaging < VintaSoft Imaging .NET SDK and Plug-ins Discussions
// open PDF document
using (Vintasoft.Imaging.Pdf.PdfDocument pdfDocument = new Vintasoft.Imaging.Pdf.PdfDocument("document.pdf"))
{
// create PDF graphics for first PDF page and specify that graphics must add new content before existing content
using (Vintasoft.Imaging.Pdf.Drawing.PdfGraphics pdfGraphics = Vintasoft.Imaging.Pdf.Drawing.PdfGraphics.FromPage(
pdfDocument.Pages[0],
Vintasoft.Imaging.Pdf.Drawing.PdfGraphicsCreationMode.Prepend))
{
// create "watermark" image
using (Vintasoft.Imaging.VintasoftImage image = new Vintasoft.Imaging.VintasoftImage("watermark.jpg"))
{
// draw "watermark" image on first PDF page
pdfGraphics.DrawImage(image, new System.Drawing.RectangleF(0, 0, 600, 200));
}
}
// save PDF document to a new file
pdfDocument.Save("documentWithWatermark.pdf");
}
I tested the code you posted but I do get an exception "{"Index was outside the bounds of the array."} System.IndexOutOfRangeException.Could you send us (to support@vintasoft.com) a small working project, which demonstrates the problem? We need to reproduce the problem on our side.
Is it possible to change opacity of the background image ?