Hi,
Here is our problem scenario:
We have a word document that has a rectangular picture object.
We use Aspose.Words for .NET to read this shape from the word document , get its coordinates, save the coordinates for later and then delete the shape from the word document.
We convert this word document(without the rectangle objects) to ABCpdf document.
We then have to re-create text widgets in the pdf for the rectangle object in the exact position using XRect.class.
The text widgets when created are not placed in the correct coordinates in the pdf document. This is our problem.
Looks like the shape coordinates read using Aspose.Words for .NET is not mapping correctly to the XRect coordinates, hence the problem.
Research Details:
XRect coordinates are (left bottom right top) The origin of this space is at the bottom left of the document. Distances are measured up and right in points.
Sample code:
This is how we are capturing the word shape coordinates using Aspose.Words for .NET
info.Left = (float) shape.Left;
info.Bottom = (float)shape.Bottom;
info.Top = (float)shape.Top;
info.Right = (float)shape.Right;
XRect(info.Left + " " + info.Bottom+ " " + info.Right + " " + info.Top);
That is not working.
Please let us know how we should be capturing the coordinates of the shape using Aspose.Words for .NET from the word document to place the text widget (rectangle) in the exact location in pdf document using xRect.
Looks like we may have to compute the coordinates manually using the page height, relative horizontal, vertical positions, width and height of the shape. Is that the only option we have? Please advise.
Will appreciate your immediate help with this issue. Thank you in advance
Best Regards,
-BP