views:

157

answers:

2

Hi,

I'm creating a newspaper authoring system. Today I'm using Aspose.Words library to generate newspaper using Docx format as output, based on a lot of other documents as input.

The basic idea is to load a lot of articles documents into a List, then generate a final docx with newspaper.

We need to get the total height of a text (with images and tables) inside columns. As libraries like Aspose.Words deal with Docx format like DOM, there isn't way to know how text will be arranged inside columns. Then I can't know the real height.

We've worked in our own way to get this height. I'm using MeasureString() function from System.Drawing.Graphics namespace. It returns width and height used by string and I can estimate how many lines (and points or inches) it will use inside a column.

But it is very poor and we need a more decent solution. We are thinking to use OpenXML SDK to get this Height, can we?

Aspose.Words doesn't support a way to know it and all Render classes are private to the library.

Can you think a new way to get this height?

Thank you, Daniel Koch

A: 

Hi Daniel, I have almost the same problem that you have.. But in my case I'm dealing with Questions inside an Test Exam.. Well nowadays, we are using RTF to build the questions and a RichTextBox the measure the height.. Just like that (http://blogs.technet.com/david_bennett/archive/2005/04/06/403402.aspx).. And I wanna to migrate to DOCX.. But still no luck on how to measure the question with tables and images.. :-( Right now I'm studying the Document Members (http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word._document_members.aspx), to try to do with Word Automation..

Regards,

Bruno

Bruno Oliveira
A: 

Hi.

Thank all for answer.

I finished it changing Aspose.Words to PDFLib. Now I can control pages, columns or anything using Postscript Points.

We keep Aspose.Words only to content import, but it isn't indicate to print newsletter.

Daniel Koch