Hi,
I am using the latest version of Spire.PDF .net 4.6. I have a requirement to print PDF's generated from a separate system. When in test mode I want to add a "Testing" watermark before printing. I have tried using the following code and then printing but the Watermark does not appear:
var pdf = new PdfDocument();
pdf.LoadFromFile(filePath);
PdfPageBase page = pdf.Pages[0];
page.BackgroundImage = watermark; // This is a Image type
pdf.PrintSettings.PrinterName = item.QueueName;
pdf.PrintSettings.Duplex = System.Drawing.Printing.Duplex.Vertical;
pdf.PrintSettings.Color = true;
pdf.Print();
IF use the following code:
private void AddWaterMark(string filePath, Image watermark)
{
var pdf = new PdfDocument();
pdf.LoadFromFile(filePath);
PdfPageBase page = pdf.Pages[0];
page.BackgroundImage = watermark;
pdf.SaveToFile(filePath);
pdf.Dispose();
}
and then reload the saved file the watermark appears when printed.
regards
Dan.