Hi, i have problem with try to put a watermarker in my PDf files, the first page is correct, but the second don´t have the style. This is mi code:
public static void Generar(string ruta, string rutadestino, string marca)
{
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory + “Aspose.PDF.NET.lic”));
Document document = new Document(ruta);
WatermarkArtifact artifact = new WatermarkArtifact();
artifact.SetTextAndState(
marca,
new TextState()
{
FontSize = 18,
ForegroundColor = Color.Black,
Font = FontRepository.FindFont(“Courier”)
});
artifact.ArtifactHorizontalAlignment = HorizontalAlignment.Center;
artifact.ArtifactVerticalAlignment = VerticalAlignment.Center;
artifact.Rotation = 45;
artifact.Opacity = 0.2;
artifact.IsBackground = false;
foreach (Page page in document.Pages)
{
for (int iy = 10; iy <= 800; iy++)
{
for (int i = 0; i <= 600; i++)
{
artifact.Position = new Aspose.Pdf.Point(i, iy);
page.Artifacts.Add(artifact);
i += 100;
}
iy += 88;
}
}
document.Save(rutadestino);
}
image.png (107,8 KB)