Welcome Guest Search | Active Topics | Sign In | Register

Line Breaks creating a PDF Options
Dib Oglesby
Posted: Wednesday, August 10, 2011 12:34:14 PM
Rank: Member
Groups: Member

Joined: 7/19/2011
Posts: 14
I am copying text from a rich text box using an AcmText object, and then rendering it. It appears that any line break (cf + lf) is being ignored when the PDF file is created. Also, I have noticed that adding an AcmLineBreak seems to only insert a space.

Am I using the wrong items to add the text to the PDF? Here is a sample:

text = New AcmText(rtfHolder.SelectedText)
text.Style.FontStyle = FontStyle.Italic
text.Style.FontSize = 10
render.Render(text)
render.Render(New AcmLineBreak)

Thanks
eo_support
Posted: Wednesday, August 10, 2011 12:43:43 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

By default, AcmText ignores line breaks so that it's possible for you to generate a single paragraph from multiple lines of text literal. We will have an option for you enable/disable this feature.

AcmLineBreak works only if you use it in the middle of your render tree. For example:

render.Render(text1, new AcmLineBreak(), text2)

Will insert a line break in between text1 and text2.

Alternatively, you can also use AcmParagraph. An AcmParagraph will automatically start a new line.

Hope this helps. Please feel free to let us know if you have any more question.

Thanks!
Dib Oglesby
Posted: Wednesday, August 10, 2011 1:54:38 PM
Rank: Member
Groups: Member

Joined: 7/19/2011
Posts: 14
Using the paragraphs lets me put in the line breaks. Thanks.

But how do I preserve the line breaks from the copied text?
eo_support
Posted: Wednesday, August 10, 2011 1:57:06 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

For that you will have to wait for our next build, which should be out today or tomorrow. We have an option on AcmText that supposes to let you to specify whether ignore line break or not but it's not working correctly in the current build. That will be fixed in the next build.

Thanks!
eo_support
Posted: Thursday, August 11, 2011 4:24:20 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We have posted a 2011.2.56 that addressed this issue. You would need to set AcmText's AutoTrim to false to preserve line breaks. For example:

Code: C#
//Create an AcmText object with multiple lines of text
AcmText text = new AcmText(@"Hello
World");

//Set AutoTrim to false so that AcmText won't remove the line
//breaks. The default value is true
text.AutoTrim = false;


Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.