PDA

View Full Version : Page Margin Of Tables


Sefai
January 24, 2004, 18:21:13
I am using both 10.1 .NET and 10.1 ActiveX Server. I use .NET in the windows form based client applications to create the document, and ActiveX in the XML Web Service, to convert these documents to PDFs when necessary. I am using RTF templates on the client side to create new RTF docs. When I load the newly created docs on the server side to the ActiveX control, page size and page margins are set correctly except the tables; tables width is always smaller then the real page width (pagewidth - pagemarginL - pagemarginR).

How will I correct this?

Björn Meyer
January 26, 2004, 10:12:17
Hello Sefai

Do you use the LoadSaveAttribute property to get the values for the page settings in the load process?

Sefai
March 1, 2004, 13:08:55
Sorry about the delay, but I was working on something else.

Dear Björn, I am using TXTextControl.Net version to create the document and then save to a byte array as follows:

[COLOR=blue]SaveSettings.PageMargins = wordControl.PageMargins;
SaveSettings.PageSize = wordControl.PageSize;

wordControl.Save(out s1, TXTextControl.StringStreamType.RichTextFormat, SaveSettings);

And send this array to a Web Service which uses ActiveX version of TextControl.
And load it like this:

[COLOR=blue]

Tx4oleLib.ILicManager licenceManager = new Tx4oleLib.TXLicenseManagerClass();
Tx4oleLib.TXTextControl txTextControl = new Tx4oleLib.TXTextControl();

txTextControl.EnableAutomationServer();
txTextControl.ResetContents();

txTextControl.ViewMode = 1;

txTextControl.LoadFromMemory(paper[1], 5, 0);

int ph = (int)txTextControl.get_LoadSaveAttribute(Tx4oleLib .LoadSaveAttributeConstants.txDocHeight);
int pw = (int)txTextControl.get_LoadSaveAttribute(Tx4oleLib .LoadSaveAttributeConstants.txDocWidth);
int pl = (int)txTextControl.get_LoadSaveAttribute(Tx4oleLib .LoadSaveAttributeConstants.txDocLeftMargin);
int pb = (int)txTextControl.get_LoadSaveAttribute(Tx4oleLib .LoadSaveAttributeConstants.txDocBottomMargin);
int pt = (int)txTextControl.get_LoadSaveAttribute(Tx4oleLib .LoadSaveAttributeConstants.txDocTopMargin);
int pr = (int)txTextControl.get_LoadSaveAttribute(Tx4oleLib .LoadSaveAttributeConstants.txDocRightMargin);

txTextControl.PageHeight = ph;
txTextControl.PageWidth = pw;
txTextControl.PageMarginL = pl;
txTextControl.PageMarginB = pb;
txTextControl.PageMarginT = pt;
txTextControl.PageMarginR = pr;


byte []bNewData = new byte[1];

txTextControl.set_LoadSaveAttribute(Tx4oleLib.Load SaveAttributeConstants.txDocHeight, ph);
txTextControl.set_LoadSaveAttribute(Tx4oleLib.Load SaveAttributeConstants.txDocWidth, pw);
txTextControl.set_LoadSaveAttribute(Tx4oleLib.Load SaveAttributeConstants.txDocLeftMargin, pl);
txTextControl.set_LoadSaveAttribute(Tx4oleLib.Load SaveAttributeConstants.txDocBottomMargin, pb);
txTextControl.set_LoadSaveAttribute(Tx4oleLib.Load SaveAttributeConstants.txDocTopMargin, pt);
txTextControl.set_LoadSaveAttribute(Tx4oleLib.Load SaveAttributeConstants.txDocRightMargin, pr);

bNewData = (byte[])txTextControl.SaveToMemoryBuffer(bNewData, 12, 0);

txTextControl = null;
licenceManager = null;

As you see I convert it to PDF, but save both versions RTF and PDF to the database. But when I read them, PageSize is right, and PageMargins are also right for the text, but not for the tables. Table widts are a bit shorter, they start at the right position but ends before the page size ends.

I will also send you a screenshot which shows the behaviour.

Best Regards.