We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

GraphInfo's Linewidth removes fillcolor

Hello,

While using GraphInfo object if I don’t specify LineWidth property it takes value as 1. So I need to specify LineWidth=0. Once I specify LineWidth =0 then my rectangle becomes transparent it doesn’t have color mentioned in fill color property.
In below code i have shown 2 boxes with LineWidth property set to 1 and 0 respectively.

var section = pdfDocument.Pages.Add();

        var pageSize = PageSize.A0;
        section.SetPageSize(pageSize.Width, pageSize.Height);
        section.PageInfo.Margin = new MarginInfo
        {
            Left = 36,
            Top = 36,
            Right = 36,
            Bottom = 36,
        };
        section.PageInfo.IsLandscape = true;

        var canvas = new Graph(2000, 2000)
        {
            Top = 0,
            Left = 0,
            Border = new BorderInfo(BorderSide.All, 1),
        };
        section.Paragraphs.Add(canvas);

        //Box 1 - adding
        var boxShape = new Aspose.Pdf.Drawing.Rectangle(
            500
            , 500, 400, 400)
        {
            //RoundedCornerRadius = 3,
        };

        boxShape.GraphInfo.FillColor = Color.Blue;
        boxShape.GraphInfo.LineWidth = 1;
        boxShape.GraphInfo.Color = Color.Red;
        canvas.Shapes.Add(boxShape);

        //Box 2 - adding
        var boxShape2 = new Aspose.Pdf.Drawing.Rectangle(
            10
            , 10, 400, 400)
        {
            //RoundedCornerRadius = 3,
        };

        boxShape2.GraphInfo.FillColor = Color.Blue;
        boxShape2.GraphInfo.LineWidth = 0;
        boxShape2.GraphInfo.Color = Color.Red;
        canvas.Shapes.Add(boxShape2);

Please provide the solution to this issue.

@sgarg.saba

We have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as PDFNET-51253. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.