Free Support Forum -

Determain the position X-Y from an node on a page


I need to build a report with WORD. I decide to use Aspose.Word.

I need to make the following:
=================== Start of a page

2 x TV 1000,00
1 x Remote 35,00
1 x Stereo 1500,00
Transport 48500,00
===================== End of page / Next Page
Transport prev Page 48500
1 x Sonos 1400,00

So I need to build a report with serveral products and prices (each line can have a different height because of a single line or multiply line descriptions on a table/row, even different fonts, styles and sizes.)
At the near end of the page I need to calculate the running total, place it at the bottom as a ‘transport’ value and display it on the top of the next page.

My problem is that I need to check to position of the last item on the page (1 x stereo in my sample), and check wheter there is room to insert a ‘transport’ row.
Because every document can be saved as a PDF, as a IMAGE, I would image that it world be possible, even if I could find it in pixels.

Any ideas how i can realize and solve my problem ??

Best Regards
Marcel Stap


Thanks for your request. There is no way to determine position of nodes on the page or calculate space remaining on the page.

However, I think, this is not actually required in your case. I think, you can use AlowBreakAcrossPages options of table rows to disallow the row to break across pages. In this case, if there is enough space on a page for row, it will remain on this page, if not it will be moved to the next page.

Please let us know if you need more information, We are always glad to help you.

Best regards,

I can understand that aspose does not offer an exact position of any text.

This is very unforunate.
But word give me a small way to determain the height of an row relative to the top of the page.

Fot this I use the following range-information.

lPos = wRng.Information(wdVerticalPositionRelativeToPage) '<-- Position this row

Does the WORD version of aspose also offer some information ??

Of does the PDF version offer a solution ??

Hope to here from you.

Best Regards
Marcel Stap


Thanks for your request. MS Word document is flow document and does not contain any information about its layout into lines and pages. So there is no way to determine on which page and where on the page some particular node is located.

In Aspose.Words we use our own Rendering Engine, which layouts Word document into pages. Using this Rendering Engine it is possible to determine position of the particular node. But currently there is no public API to achieve this. But we have plans to expose layout information. Your request has been linked to the appropriate issue. You will be notified as soon as this feature is supported.

Best regards.

Also have you tried using the way suggested by Alexey in the previous post?

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.