when having a document with a text fragment with a transparency, the transparency is not respected. the full color is displayed.
Workaround:
1. Subscribe to the PdfViewer.PageElementsLoaded event.
2. Enumerate the page's content elements.
3. Find TextFragment objects whose text matches "Watermak text!".
4. Set the fill color to the fragment with transparency
<telerik:RadPdfViewer x:Name="pdfViewer"
PageElementsLoaded="pdfViewer_PageElementsLoaded"/>and the page element loaded event with the workaround implemented.
private void pdfViewer_PageElementsLoaded(object sender, Telerik.Maui.Controls.PdfViewer.PageElementsLoadedEventArgs e)
{
UpdateWatermarkTransparency(e.Page);
}
private static void UpdateWatermarkTransparency(RadFixedPage fixedPage)
{
foreach (var contentElement in fixedPage.Content)
{
if (contentElement is Telerik.Windows.Documents.Fixed.Model.Text.TextFragment textBlock)
{
if(textBlock.Text.Contains("Watermark text!"))
{
textBlock.Fill = new RgbColor(60, 255, 0, 0);
}
}
}
}Regards,
Didi
Progress Telerik