I want to create a template in Microsoft Word, save it as filtered html, 
fill it with data using web2py, and then output it as a PDF file. Why? So 
my secretary can create the template without having to look at that HTML 
stuff!

Unfortunately Microsoft puts some of the pagebreaks in BR tags which may 
work in IE but not in Chrome. I could parse the html and change the tags if 
that were easy but I cannot see how to do it in web2py and I don't want to 
import some other parser just for this. Otherwise I will just use the 
workaround which is to add the breaks to paragraph settings rather than 
doing ctrl-enter.

On Monday, 23 April 2012 19:11:23 UTC+1, Wikus van de Merwe wrote:
>
> So you have an HTML code as input and would like to change some tags to 
> some others ones. But why? You should never had the need to build the HTML 
> page from another HTML page in web2py. You should rather simply combine the 
> data and a view. In your example, the view could be this:
>
> pages.css
> ---------------
> .page {
>     page-break-after: always;
> }
>
> pages.html
> ----------------
> {{ for page in pages: }}
>      {{=DIV(page.content, _class="page")}}
>
> And if you really need to process the HTML, you should use an HTML parser 
> e.g. lxml or html5lib.
>
>

Reply via email to