PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Draw shapes
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2123
Page 1 of 1

Author:  cmarian [ Thu Aug 30, 2012 1:50 pm ]
Post subject:  Draw shapes

Hi,

I'm using MigraDoc in my project and I need to construct an ellipse. It is possible this ? Which DocumentObjectModel should I use ?

Thank you!

Author:  cmarian [ Tue Sep 04, 2012 6:12 am ]
Post subject:  Re: Draw shapes

For a better understand I will give an example with rectangle:

Document document = new Document();
MigraDoc.DocumentObjectModel.Section section = document.AddSection();
TextFrame textFrame = new TextFrame();
textFrame.Width = new Unit(200);
textFrame.Height = new Unit(200);
textFrame.RelativeHorizontal = RelativeHorizontal.Page;
textFrame.RelativeVertical = RelativeVertical.Page;
textFrame.WrapFormat.DistanceLeft = new Unit(10, UnitType.Millimeter);
textFrame.WrapFormat.DistanceTop = new Unit(10, UnitType.Millimeter);
textFrame.LineFormat.Width = new Unit(2);
textFrame.LineFormat.Color = MigraDoc.DocumentObjectModel.Colors.Black;
textFrame.FillFormat.Color = MigraDoc.DocumentObjectModel.Colors.Green;
section.Add(textFrame);

It is possible to create ellipse in this manner ?

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/