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
===================== 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 ??
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.
I can understand that aspose does not offer an exact position of any text.
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.
Also have you tried using the way suggested by Alexey in the previous post?