Hello,
I have a problem with adding watermarks to some PDF's. While the code below adds them correctly, the whole page becomes black after it.
The links for both the source and the result files are below. Please advise on this bug.
https://www.dropbox.com/s/ol8pju00n751k ... e.pdf?dl=0https://www.dropbox.com/s/4t2zkn9fst81m ... n.pdf?dl=0Code:
public class PdfMaker
{
public void CopyPdf(string source, string destination)
{
var bytes = File.ReadAllBytes(source);
bytes = AddWatermarksToPdf(bytes);
File.WriteAllBytes(destination, bytes);
}
private byte[] AddWatermarksToPdf(byte[] pdfBytes)
{
var pdf = new PdfWrapper(pdfBytes);
var watermarkText = "Hello, World!";
var watermarks = new[]
{
new PdfWatermark
{
Text = watermarkText,
Coordinates = new Point(25, 100),
Angle = 90,
BrushColor = Color.Black,
Font = new Font("Arial", 4, FontStyle.Regular, GraphicsUnit.World)
},
new PdfWatermark
{
Text = watermarkText,
Coordinates = new Point(5, 200),
Angle = 90,
BrushColor = Color.White,
Font = new Font("Arial", 1, FontStyle.Regular, GraphicsUnit.World)
}
};
pdf.AddWaterMark(watermarks);
return pdf.ToArray();
}
}