Hi Guys,
I needed to be able to add a watermark to a pdf document - rotation is 40 and with 30% opacity.
I have the following code where rotation worked but couldn’t make opacity work.
TextParagraph paragraph = new TextParagraph();
paragraph.Position = new Position(100, 100);
//create text fragment
TextFragment textFragment1 = new TextFragment(watermark);
//set text properties
textFragment1.TextState.FontSize = 120.0F;
textFragment1.TextState.FontStyle = FontStyles.Bold;
textFragment1.TextState.ForegroundColor = Aspose.Pdf.Color.FromArgb(220, 220, 220, 220);
textFragment1.TextState.Font = FontRepository.FindFont("Verdana");
//set rotation
textFragment1.TextState.Rotation = 40;
// create TextBuilder object
TextBuilder textBuilder = new TextBuilder(page);
// append the text paragraph to the PDF page
textBuilder.AppendText(textFragment1);
If I couldn’t achieve this using TextFragment+TextBuilder approach, can you provide me please with alternative?
Thank you,
Ruby