HTML to PDF and Page Breaks

HTML to PDF and Page Breaks

  
I've seen it asked a few times in the forums, but no one seems to answer it (which should probably tell me the answer).  Is there a way to force a page break using the HTML to PDF Converter?

Thanks,
Cory
OK - I did a little more searching and found a solution for my problem.  I had a series of tables that were being listed with a brief instruction/explaination before the table.  My problem was the instruction/explaination was being printed at the bottom of page 1 while the table header and contents were on page 2.  Since the data that came before the tables varied in length, I couldn't just make the form a little longer to push it down.  I ended up creating a style .nobreak (see below) that I applied to the container that contained the instructions and table.  Worked perfectly.

.nobreak {
    page-break-inside: avoid;
}
Thanks for sharing!
In our application, we needed to always break on a certain container, and used a similar approach, but with the page-break-after tag.

check for more info on these CSS tags here: http://css-tricks.com/almanac/properties/p/page-break/
FYI - if I specify a page size of Letter, the page-break-inside style won't work - it will break it in the middle of the table.

I can't seem to get the page-break-after or page-break-before to work (whether I change the page size or leave it as the default).

Cory
we used it in a div container, not a table... can it be because of that?
I tried enclosing the table in a container and applying the style to the container and I also tried adding a container after the table and applying the style.  It didn't seem to want to force the page break in either case.  Because of the way I am doing some foratting, I have nested containers and I'm trying to apply the page break at about the third level - maybe that has something to do with it? 

Thanks for the suggestion though. 
After printing out a form with a longer top section than before all of a sudden the nobreak style stopped working.  The only solution that I have found that is working is to split it into two webpages.  Then when I execute the HtmlToPdfConverter action pass both URLs separated by a space in the URL parameter.  It will automatically do a page break between the URLs.

Hope this helps
Cory
Cory Creamer wrote:
After printing out a form with a longer top section than before all of a sudden the nobreak style stopped working.  The only solution that I have found that is working is to split it into two webpages.  Then when I execute the HtmlToPdfConverter action pass both URLs separated by a space in the URL parameter.  It will automatically do a page break between the URLs.

Hope this helps
Cory
 
Hi, I've been trying to do this but with no success. Basically, what I've done is just insert a string of URL (which work fine btw if I just keep it at one URL) but as soon as I do something like "url1 url2", I get two pages, but the first one will (always) be simply empty. I do have the following in the OtherArgs "--margin-bottom 0 --margin-left 0 --margin-right 0 --margin-top 0" but I don't think this would be an issue (right?). What am I doing wrong?

I am using service studio 9.0.1.5
I suggest to check out the documentation of the tool being used.
I Assume it's still wkhtmltopdf

So check out http://wkhtmltopdf.org/

Hello all.

What I have found out:

1) I've used successfully

.pagebreakafter_always {
    page-break-after: always;
}

in a div nested inside others divs, BUT, the outer divs must not have any styling applied. So for example, if you are using grid and defining columns (for example, 8 col) for the width of the outer divs, the page breaks will stop working.

2) The documentation of the tool does not say explicitly anything about page breaks. As far as I can figure it out from the documentation, to do page breaks you have to pass several URLs, each one starting in a new page, as was said before in this link: http://www.outsystems.com/forums/discussion/11858/html-to-pdf-and-page-breaks/#Post42491

3) Suggestion: To really make sure no "hidden" styles are being used, I would suggest, as it is also suggested by OutSystems best practices for designing emails, is to define a Theme completely empty, with no styling whatsoever, and use it as the Theme for the web flow where you have your web screen with the HTML content to be converted to PDF.

Hope this is helpful.