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.

Scaled MultiText and horizontal alignement

Thread ID:

Created:

Updated:

Platform:

Replies:

54176 Jan 3,2007 08:24 AM Feb 3,2007 02:32 AM Windows Forms 4
loading
Tags: PDF
Mario Bianchi
Asked On January 3, 2007 08:24 AM

Hi,
Found a problem with Graphics.DrawMultiText when both horizontal scaling and horizontal aligmement is used, right and centered text are not draw at corect x position.
Here the code to reproduce the problem:

PDFDocument pdfDoc = new PDFDocument();
IPDFFont pdfFont;

pdfFont = pdfDoc.Fonts.Add (Environment.GetEnvironmentVariable ("systemroot") + @"\Fonts\ARIAL.TTF");
pdfFont.Size = 12.0F;

IPDFPage firstPage = pdfDoc.Pages[0];

IPDFGraphicState DrawProp = pdfDoc.CreateGraphicState ();
RectangleF DimPos = new RectangleF (200, 30, 200, 30);

DrawProp.Scale (0.5F, 0.5F);

DrawProp.TextAlignment = TextAlignment.Right;
firstPage.Graphics.DrawRectangle (DimPos, DrawProp);
firstPage.Graphics.DrawMultiText (DimPos, "Hello World!", pdfFont, DrawProp);

DimPos.Offset (0, 35);
DrawProp.TextAlignment = TextAlignment.Center;
firstPage.Graphics.DrawRectangle (DimPos, DrawProp);
firstPage.Graphics.DrawMultiText (DimPos, "Hello World!", pdfFont, DrawProp);

DimPos.Offset (0, 35);
DrawProp.TextAlignment = TextAlignment.Left;
firstPage.Graphics.DrawRectangle (DimPos, DrawProp);
firstPage.Graphics.DrawMultiText (DimPos, "Hello World!", pdfFont, DrawProp);

DimPos.Height = 60;
DimPos.Offset (0, 35);

DrawProp.TextAlignment = TextAlignment.Right;
firstPage.Graphics.DrawRectangle (DimPos, DrawProp);
firstPage.Graphics.DrawMultiText (DimPos, "Hello World!\nTest\n123\nTest Multi Lines", pdfFont, DrawProp);

DimPos.Offset (0, 65);
DrawProp.TextAlignment = TextAlignment.Center;
firstPage.Graphics.DrawRectangle (DimPos, DrawProp);
firstPage.Graphics.DrawMultiText (DimPos, "Hello World!\nTest\n123\nTest Multi Lines", pdfFont, DrawProp);

DimPos.Offset (0, 65);
DrawProp.TextAlignment = TextAlignment.Left;
firstPage.Graphics.DrawRectangle (DimPos, DrawProp);
firstPage.Graphics.DrawMultiText (DimPos, "Hello World!\nTest\n123\nTest Multi Lines", pdfFont, DrawProp);

pdfDoc.Save("Sample.pdf");

Without Scale, the code work fine.

Dhivya K [Syncfusion]
Replied On January 4, 2007 07:50 AM

Hi Mario,

Thanks again for the code! I was able to reproduce the issue. However, if we scale to the correct position, we can have the proper alignement.

Can you please replace the Scale property with the following values?

DrawProp.Scale (1f,1f);

This will make your sample work. However, I agree that while scaling the coordinates, the text should have proper alignment. I have forwarded this issue to development team.

Regards,
Dhivya.

Dhivya K [Syncfusion]
Replied On January 29, 2007 11:33 PM

Hi Mario,

This issue[defect-3314] is fixed and will be available for our next release. Could you please create direct trac incident if you are interested in patch?

Regards,
Dhivya.

Administrator [Syncfusion]
Replied On February 3, 2007 02:28 AM

Hi Mario,

This issue[defect-3314] is fixed and will be available for our next release.
Could you please open an incident in the direct trac with the forum id as the subject line if you are interested in patch?

http://www.syncfusion.com/Support/DirectTrac/logon.aspx

Thanks,
Balaji U

Administrator [Syncfusion]
Replied On February 3, 2007 02:32 AM

Hi Mario,

This issue[defect-3314] is fixed and will be available for our next release.
Could you please open an incident in the direct trac with the forum id as the subject line if you are interested in patch?

http://www.syncfusion.com/Support/DirectTrac/logon.aspx

Thanks,
Balaji U

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.

;