FloatingBox with semi-transparent background

I need to create a FloatingBox with a semi-transparent background color, and the Aspose.Pdf.Color doesn’t seem to respect the alpha value I’m providing. Here is my code:


public void FloatingBoxWithSemiTransparentBackground()
{
var pdf = new Document(@“c:\Temp\source.pdf”);
var page = pdf.Pages[1];
var semiTransparentYellow = System.Drawing.Color.FromArgb(100, System.Drawing.Color.Yellow);
var asposeVersionOfYellow = Aspose.Pdf.Color.FromRgb(semiTransparentYellow);
var floatingBox = new FloatingBox(100, 200) { Left = 30, Top = 40, BackgroundColor = asposeVersionOfYellow };
page.Paragraphs.Add(floatingBox);
pdf.Save(@“c:\Temp\alpha_test.pdf”);
}

The saved PDF does have the floating box in the right location and with the right RGB, but it is completely opaque.

How can I get the FloatingBox.BackgroundColor to respect alpha?

Hi Daniel,


Thanks for contacting support.

I
have tested the scenario and I am able to reproduce the same problem that FloatingBox is not being rendered in semi-transparent color. However I can see that its appearing on appropriate location (as per information provided in code). For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-38616. We
will investigate this issue in details and will keep you updated on the status
of a correction. <o:p></o:p>

We apologize for your inconvenience.