We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Text Alignment Issue

Thread ID:

Created:

Updated:

Platform:

Replies:

49904 Sep 29,2006 05:51 AM Oct 17,2006 06:49 AM ASP.NET Web Forms (Classic) 8
loading
Tags: PDF
Lee Diggins
Asked On September 29, 2006 05:51 AM

Hi

I''m posting here as Direct Track is showing an application error and I cannot login.

I am trying to justify some text retrieved from a data base using the code below using IPDFGraphicState propsAlign, here is my code for that page:

// Create page 3
pdfDoc.CreatePage();
IPDFPage page3 = pdfDoc.Pages[2];

// Insert text into page 3
System.IO.StreamReader page3File =
new System.IO.StreamReader(Server.MapPath("rtfs_fr/new_page_3.rtf"));
string page3Read = page3File.ReadToEnd();
page3.Graphics.DrawRTFText(new PointF(40, 20), page3Read, (float)550, (float)800);

// Set graphicstate
IPDFGraphicState props1 = pdfDoc.CreateGraphicState();
props1.BreakBehavior = AutoBreakBehavior.MultiLineTextBreak;

IPDFGraphicState propsAlign = pdfDoc.CreateGraphicState();
propsAlign.BorderColors.All = Color.Black;
propsAlign.BorderSize.All = 1;
propsAlign.DrawBorderInside = false;
propsAlign.Padding.All = 10;
propsAlign.TextAlignment = TextAlignment.Justify;
propsAlign.BreakBehavior = AutoBreakBehavior.MultiLineTextBreak;

// Assign array value to variable
string comments0 = arrComments[0];
string statements0 = arrStatements[0];

// Measure size of the statement and insert into page 3
SizeF sizeStatements0 = pdfDoc.Graphics.MeasureString(statements0, pdfFont10, (float)(450), props1);
RectangleF page3Rec1 = new RectangleF(new PointF(40, 110), sizeStatements0);
page3.Graphics.DrawMultiText(page3Rec1, statements0, pdfFont10, props1);

// Measure size of the comment and insert into page 3
SizeF sizeComments0 = pdfDoc.Graphics.MeasureString(comments0, pdfFont10, (float)(450), propsAlign);
RectangleF page3Rec2 = new RectangleF(new PointF(40, page3Rec1.Bottom + 20), sizeComments0);
page3.Graphics.DrawMultiText(page3Rec2, comments0, pdfFont9, propsAlign);


I do get the border, padding etc applied to the rectangle. but unfortunately the Justify setting is not being applied.

Any ideas guys?

Regards,

Lee

Dhivya K [Syncfusion]
Replied On September 29, 2006 09:00 AM

Hi Lee,

I was able to reproduce the issue. It is identified as bug and have been logged a bug report with development team.
We will try to fix this issue as soon as possible.You can track the status of this issue from the following link.

http://www.syncfusion.com/support/issues/pdf/Default.aspx?ToDo=view&questId=2462

Please let me know if you have anyother queries.

Thanks,
Dhivya.

Lee Diggins
Replied On October 3, 2006 03:40 AM

Hi

Thanks for letting me know.

Regards,

Lee

Dhivya K [Syncfusion]
Replied On October 3, 2006 06:35 AM

Hi Lee,

My apologies.Text alignment seem to be working fine.

I tried creating a sample such a way that I retrieve the long text from the database and applied "justify" alignment. It works fine.I was able to see the space getting adjusted as in the case of justify.

Here is a sample for your reference.
TextFlow.zip

Could you please look into the sample and let me know if it works fine.

Sorry for the confusion.

Regards,
Dhivya.

Lee Diggins
Replied On October 10, 2006 09:06 AM

Hi Dhivya

I get the sample to work as expected.

My code will not apply justification, however, it will apply, left, right and center but not justify so it has to be a bug yes?

Regards,

Lee

Lee Diggins
Replied On October 10, 2006 09:06 AM

Hi Dhivya

I get the sample to work as expected.

My code will not apply justification, however, it will apply, left, right and center but not justify so it has to be a bug yes?

Regards,

Lee

Lee Diggins
Replied On October 10, 2006 09:06 AM

Hi Dhivya

I get the sample to work as expected.

My code will not apply justification, however, it will apply, left, right and center but not justify so it has to be a bug yes?

Regards,

Lee

Dhivya K [Syncfusion]
Replied On October 11, 2006 12:54 AM

Hi Lee,

Here is a sample exactly with your code. I was not able to reproduce the issue still.
Sample:
TextAlignment.zip


Can you look into the sample if I have missed something in your code?

Here is a screen shot of the PDF file generated with your code.
Screen shot:http://www.syncfusion.com/Support/user/uploads/TextAlignment_2600d164.gif

You can notice that the text inside the rectangle is justified[as the alignment property "propsAlign" is set to "justify].

Can you modify this sample so that I can reproduce the issue? This will help me investigating further on this issue.

Thanks,
Dhivya

Administrator [Syncfusion]
Replied On October 17, 2006 06:49 AM



>Hi Lee,

I was able to reproduce the issue. It is identified as bug and have been logged a bug report with development team.
We will try to fix this issue as soon as possible.You can track the status of this issue from the following link.

http://www.syncfusion.com/support/issues/pdf/Default.aspx?ToDo=view&questId=2462

Please let me know if you have anyother queries.

Thanks,
Dhivya.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;