File tree Expand file tree Collapse file tree
HtmlRenderer.Demo.Common/TestSamples
HtmlRenderer.Demo.Console Expand file tree Collapse file tree File renamed without changes.
Original file line number Diff line number Diff line change 1+ < html >
2+ < body >
3+ < div style ="height: 826px; background-color: indianred; page-break-inside: avoid; ">
4+ This is on page 1
5+ </ div >
6+
7+ < div style ="height: 900px; background-color: purple; page-break-inside: avoid; ">
8+ This is on page 2
9+ </ div >
10+
11+ < div style ="height: 700px; background-color: red; ">
12+ This is on page 3.
13+ </ div >
14+
15+ < div style ="page-break-inside: avoid; height: 1500px; background-color: blue; padding: 10px; ">
16+ This is on page 4.
17+
18+ < div style ="height: 500px; background-color: yellow; ">
19+ This is also on page 4
20+ </ div >
21+
22+ < div style ="height: 400px; background-color: aqua; page-break-inside: avoid; ">
23+ This is on page 5
24+ </ div >
25+ </ div >
26+
27+ < div style ="background-color: orange; padding: 10px; page-break-inside: avoid; ">
28+ < div >
29+ This is on page 6
30+ </ div >
31+
32+ < div style ="background-color:yellowgreen;width:90px;height: 1000px; ">
33+ </ div >
34+ </ div >
35+
36+ </ body >
37+ </ html >
Original file line number Diff line number Diff line change 2424foreach ( var htmlSample in samples )
2525{
2626 ////Just doing one test here. Comment this for all of them.
27- if ( ! htmlSample . FullName . Contains ( "37" , StringComparison . OrdinalIgnoreCase ) ) continue ;
27+ if ( ! htmlSample . FullName . Contains ( "38" ) ) continue ;
2828
2929 //await skia.GenerateSampleAsync(htmlSample);
3030 //await svgSkia.GenerateSampleAsync(htmlSample);
Original file line number Diff line number Diff line change @@ -700,6 +700,13 @@ protected virtual async Task PerformLayoutImpAsync(RGraphics g)
700700 {
701701 this . BreakPage ( true ) ;
702702 }
703+ else if ( this . PageBreakInside == CssConstants . Avoid
704+ && ActualHeight + Location . Y > HtmlContainer . PageSize . Height
705+ && prevSibling != null )
706+ {
707+ // handle page break avoiding.
708+ this . BreakPage ( true ) ;
709+ }
703710
704711 //Start with the assumption this is zero height.
705712 ActualBottom = Location . Y ;
You can’t perform that action at this time.
0 commit comments