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

Free Support Forum - aspose.com

Adding Image in Diagram with absolute position using pixels values in Aspose.Diagram for .NET

I need to add image with absolute positioning to diagram using pixels starting from left upper corner. Is it Possible?


Would you kindly share your source Diagram file and Image along with sample code snippet that you have tried so far to add the image. We will test the scenario in our environment and address it accordingly. Also, please share the pixels value at which you want to add the image.

I don’t have code snippet, I asking how to do It with any diagram file in custom position. For example any png image at top margin 100px and left margin 100px.


We are trying to prepare code snippet for you as an example and will share with you shortly.

Okey. Waiting for It


You could set page print margin using Visio but could not set shape margin:

page.PageSheet.PrintProps.PageLeftMargin.Value = 0.5
page.PageSheet.PrintProps.PageTopMargin.Value = 0.5 

However, you could set shape text block margin:

TextBlock.LeftMargin.Value = 0.5
TextBlock.TopMargin.Value = 0.5

or set shape paragraph:

para.IndLeft.Value = 0.5;
para.IndFirst.Value = 0.5;

We hope this information would be helpful in achieving your requirements. In case of any further assistance, please feel free to let us know.

1 Like