Free Support Forum - aspose.com

Absolute Positioning

Hello,

I am evaluating Aspose Words for .Net,

I need to retrieve a absolute position of an object, it may be a paragraph or an image it doesnt realy matter.

I have tried a few things based in a few examples i have found in Aspose forums but i have been unable to get what i need.

Heres my test:

Document doc = new Document( filePath );

NodeCollection nc = doc.GetChildNodes( NodeType.Paragraph, true, false );

Paragraph p = (Paragraph) nc[ nc.Count -1 ];

PointF size = new PointF( ( float )p.ParentSection.PageSetup.PageWidth, ( float )p.ParentSection.PageSetup.PageHeight );

Shape shape = new Shape( doc, ShapeType.Image );

shape.RelativeHorizontalPosition = RelativeHorizontalPosition.Margin;

shape.RelativeVerticalPosition = RelativeVerticalPosition.Paragraph;

shape.ImageData.SetImage( @"C:\temp\red.png" );

shape.WrapSide = WrapSide.Both;

shape.WrapType = WrapType.TopBottom;

shape.Width = 100;

shape.Height = 100;

p.AppendChild( shape );

doc.UpdatePageLayout( );

RectangleF bounds = new RectangleF( ( float )shape.Left,( float )shape.Top,( float )shape.Width,( float )shape.Height );

Is it possible to get an absolute position directly or indirectly from an object?

Best regards,

Luis Fernandes

Hello

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for your interest in Aspose.Words. MS Word document is flow document and does not contain any information about its layout. Our Rendering Engine layouts documents into lines, pages etc.

And unfortunately, there is no way to find the position of the particular node on page. Your request has been linked to the appropriate issue. You will be notified as soon as this feature is supported.

Best regards,

The issues you have found earlier (filed as WORDSNET-2978) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(58)