Setting Gradient color

Hi,


I was filling my rectangle with gradient color by using following code snippet.

rectangle.GraphInfo.FillColor = new Color
{
PatternColorSpace =
new GradientAxialShading(
gradientBottom.ToAsposeColor(),
gradientTop.ToAsposeColor())
{
StartX = 0,
StartY = boxShape.Bottom,
EndX = 0,
EndY = boxShape.Bottom + boxShape.Height
}
};

How i can achieve the same in new DOM.

Regards,
Sandeep

Hi Sandeep,


Thanks for your inquiry. After initial investigation, we have logged an enhancement ticket PDFNET-41130 to support gradient color support in new DOM. We will keep you updated about the issue resolution progress.

We are sorry for the inconvenience caused.

Best Regards.

Hi Sandeep,

Thanks for your patience. We have good news for you, your above reported issue (PDFNET-41130) has been resolved. Its fix will be available in upcoming release i.e. Aspose.Pdf for .NET 12.0.0. Hopefully it will be published in current week and with new release, you can use following code snippet for Gradient color setting in new DOM.

string outFile = "GradientColor_DOM.pdf";
Document doc = new Document();
Page page = doc.Pages.Add();
Graph graph = new Graph(300, 300);
page.Paragraphs.Add(graph);
Drawing.Rectangle rect = new Drawing.Rectangle(0, 0, 300, 300);
graph.Shapes.Add(rect);
rect.GraphInfo.FillColor = new Aspose.Pdf.Color
{
    PatternColorSpace = new GradientAxialShading(Color.Red, Color.Blue) 
    { 
        Start = new Point(0, 0), 
        End = new Point(300, 300) 
    }
};
doc.Save(outFile);

Please feel free to contact us for any further assistance.

Best Regards,

The issues you have found earlier (filed as PDFNET-41130) have been fixed in Aspose.Pdf for .NET 12.0.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.