>
> I'm using Windows; tried the highlighted command below so that PDF maker 
> would replace Windows line-break with <br>, but didn't work


>         text = 
> (r.client_controlled_documentation_stakeholder_content_narrative_description)

        str(text).replace('\n','<br />\n')

        story.append(Paragraph(escape(text), styles["Normal"]))



On Tuesday, January 15, 2019 at 8:15:50 AM UTC-8, Alex Glaros wrote:
>
> When converting to PDF, line breaks from a text field are collapsed. How 
> to retain the line breaks? Here is the PDF-creating code
>
>  
>
>         text = 
> (r.client_controlled_documentation_stakeholder_content_narrative_description)
>
>         story.append(Paragraph(escape(text), styles["Normal"]))
>
>                                
>
> I tried
>
>  
>
>     
> db.client_controlled_documentation_stakeholder_content.client_controlled_documentation_stakeholder_content_narrative_description.represent
>  
> = lambda value, row : PRE(value)
>
>                
>
> and also tried
>
>  
>
>     
> db.client_controlled_documentation_stakeholder_content.client_controlled_documentation_stakeholder_content_narrative_description.represent
>  
> = lambda v, r: DIV(v, _style='white-space:nowrap')
>
> Alex Glaros
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to