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

Free Support Forum - aspose.com

Aspose.Pdf.Drawing.Graph various properties not working

Hi,


I am using following code to add graph to a page. Let me know what is wrong with the code that any property is not reflected in generated pdf except width and height.

Aspose.Pdf.Page page = pdfDocument.Pages.Add();
page.PageInfo = new Aspose.Pdf.PageInfo
{
IsLandscape =false,
Width = Aspose.Pdf.PageSize.A4.Width,
Height = Aspose.Pdf.PageSize.A4.Height,
};

var root = new Aspose.Pdf.Drawing.Graph(100, 100)
{
GraphInfo = new GraphInfo
{
Color = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.RosyBrown),
LineWidth = 50.0f,
FillColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.RosyBrown),

},
Title = “Test by Sandeep”,
HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Left
};
PdfDocument.Save(“Test.pdf”);
Regards,
Sandeep

Hi Sandeep,


Thanks for your inquiry. After initial investigation, we have logged an enhancement ticket as PDFNEWNET-36626 in our issue tracking system for further investigation and implementation. We will keep you updated about the issue resolution progress via this forum thread.

We are sorry for the inconvenience caused.

Best Regards,

The issues you have found earlier (filed as PDFNEWNET-36626) have been fixed in Aspose.Pdf for .NET 9.6.0.


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

Hi Sandeep,


Thanks for your patience. We are implementing properties from old generator Graph calls to new generator. Moreover, please note you are not adding graph to Page paragraph, so we will get an empty document.

Document PdfDocument = new Document();<o:p></o:p>

Aspose.Pdf.Page page = PdfDocument.Pages.Add();

page.PageInfo = new Aspose.Pdf.PageInfo

{

IsLandscape = false,

Width = Aspose.Pdf.PageSize.A4.Width,

Height = Aspose.Pdf.PageSize.A4.Height,

};

var root = new Aspose.Pdf.Drawing.Graph(100, 100)

{

GraphInfo = new Aspose.Pdf.GraphInfo

{

Color = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.RosyBrown),

LineWidth = 50.0f,

FillColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.RosyBrown),

},

Title = new TextFragment("Test by Sandeep"),

HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Left,

};

root.Shapes.Add(new Aspose.Pdf.Drawing.Rectangle(0, 0, 100, 100));

page.Paragraphs.Add(root);

PdfDocument.Save(myDir+"Graph_Test.pdf");

Please feel free to contact us for any further assistance.


Best Regards,