Search code examples
c#.netpdf-generationpechkintuespechkin

How can I start content on a new page if it doesn't fit


I'm using Pechkin to convert html content with css to pdf files.

The problem I am facing is that a part of a html block is being cut off because it doesn't fit on the current page anymore.

Now what i would like is that when the content doesn't fit on the current page that it creates it on the next page.

Is this possible with Pechkin?

Code:

var pechkin = new SynchronizedPechkin(new GlobalConfig());
return pechkin.Convert(new ObjectConfig()
                         .SetLoadImages(true).SetZoomFactor(1.5)
                         .SetPrintBackground(true)
                         .SetScreenMediaType(true)
                         .SetPrintBackground(true)
                         .SetCreateExternalLinks(true), html);

Problem


Solution

  • Instead of using float elements I switched to inline-block elements. I gave the inline-block elements the style: page-break-inside: avoid; and it now knows when to start on a new page.