table{
width: 100%;
page-break-after: always;
}
All aspects of the print media are ignored in the resulting pdf.
I reran the test removing the style sheets and using this:
I think you have some strange overriding rule in the @media for body. I removed those to what you want.
Kevin Brown
From: rbreed [mailto:notifications@github.com]
Sent: Monday, November 17, 2014 5:38 PM
To: Xportability/css-to-pdf
Subject: [css-to-pdf] can't get page break to work (#2)
Kevin, This is an update to http://stackoverflow.com/questions/26961205/using-css-print-media-with-xporability-css-to-pdf. I downloaded the revised xepOnline.jqPlugin.js file. I reran the test using this code:
The css/Xeptest.css file is:
html, body { margin:0; padding:0; height:100%; font: 1em Ubuntu,Arial,Helvetica,sans-serif; }
The css/print-media.css is:
.noprint { display:none; }
.print { width:100%; }
body, article { width: 100%; margin: 0; padding: 0; font-size: 10pt; font-family:'Times New Roman',Times,serif; }
table, div{ width: 100%; page-break-after: always;
}
table{ width: 100%; page-break-after: always;
} All aspects of the print media are ignored in the resulting pdf. I reran the test removing the style sheets and using this:
I got a blank pdf. Firebug shows this:
!DOCTYPE div [ <!ENTITY % winansi SYSTEM "http://xep.cloudformatter.com/doc/XSL/winansi.xml"> %winansi;]><?xml-stylesheet type="text/xsl" href="http://xep.cloudformatter.com/Doc/XSL/xeponline-fo-translate-2.xsl"?>
xepOnli...ugin.js (line 201) POST http://xep.cloudformatter.com/Chandra.svc/genpackage
200 OK 782ms
jquery-....min.js (line 4) HeadersPostResponseXMLCookies
This works.
http://jsfiddle.net/503rdexa/1/
I think you have some strange overriding rule in the @media for body. I removed those to what you want.
Kevin Brown
From: rbreed [mailto:notifications@github.com] Sent: Monday, November 17, 2014 5:38 PM To: Xportability/css-to-pdf Subject: [css-to-pdf] can't get page break to work (#2)
Kevin, This is an update to http://stackoverflow.com/questions/26961205/using-css-print-media-with-xporability-css-to-pdf. I downloaded the revised xepOnline.jqPlugin.js file. I reran the test using this code:
<!doctype html>
The css/Xeptest.css file is:
html, body { margin:0; padding:0; height:100%; font: 1em Ubuntu,Arial,Helvetica,sans-serif; }
The css/print-media.css is:
.noprint { display:none; }
.print { width:100%; }
body, article { width: 100%; margin: 0; padding: 0; font-size: 10pt; font-family:'Times New Roman',Times,serif; }
table, div{ width: 100%; page-break-after: always;
}
table{ width: 100%; page-break-after: always;
} All aspects of the print media are ignored in the resulting pdf. I reran the test removing the style sheets and using this:
html, body { margin:0; padding:0; height:100%; font: 1em Ubuntu,Arial,Helvetica,sans-serif; } @media print { .noprint {display:none;} .print {width:100%; display:table-header-group;} body, article {width: 100%; margin: 0; padding: 0; font-size: 10pt; font-family:'Times New Roman',Times,serif;} table, div { page-break-after: always;} }
I got a blank pdf. Firebug shows this:
!DOCTYPE div [ <!ENTITY % winansi SYSTEM "http://xep.cloudformatter.com/doc/XSL/winansi.xml http://xep.cloudformatter.com/doc/XSL/winansi.xml%22%3E "> %winansi;]><?xml-stylesheet type="text/xsl" href="http://xep.cloudformatter.com/Doc/XSL/xeponline-fo-translate-2.xsl http://xep.cloudformatter.com/Doc/XSL/xeponline-fo-translate-2.xsl%22?%3E "?>
Image removed by sender.
Column 1
Column 2
Column 3
Row 1 Cell 1
Row 1 Cell 2
Row 1 Cell 3
Row 2 Cell 2
Row 2 Cell 3
Row 3 Cell 1
Column 1
Column 2
Column 3
Row 1 Cell 1
Row 1 Cell 2
Row 1 Cell 3
Row 2 Cell 2
Row 2 Cell 3
Row 3 Cell 1
xepOnli...ugin.js (line 201) POST http://xep.cloudformatter.com/Chandra.svc/genpackage
200 OK 782ms
jquery-....min.js (line 4) HeadersPostResponseXMLCookies
ERROR: file:/C:/Program Files (x86)/RenderX/XEPWin/xep/xep.xml: Font family 'Exo' defined twice; first definition preserved/a:anyTypeERROR: file:/C:/Program Files (x86)/RenderX/XEPWin/xep/xep.xml: Font family 'Slabo px' defined twice; first definition preserved/a:anyTypeERROR: file:/C:/Program Files (x86)/RenderX/XEPWin/xep/xep.xml: Font family 'Cabin Sketch' defined twice; first definition preserved/a:anyTypeERROR: file:/C:/Program Files (x86)/RenderX/XEPWin/xep/xep.xml: Font family 'Droid Serif Thai' defined twice; first definition preserved/a:anyTypeevent system-id cliser://localhost/C:/Windows/TEMP/45fl2ver.lkt/a:anyTypeopenState compile/a:anyTypeopenState masters/a:anyTypeopenState sequence-master/a:anyTypeevent master-name section_1/a:anyTypeclos eState s equence-master/a:anyTypecloseState masters/a:anyTypeopenState sequence/a:anyTypeevent master-reference section_1/a:anyTypeopenState static-content/a:anyTypeevent flow-name xsl-region-before/a:anyTypecloseState static-content/a:anyTypeopenState static-content/a:anyTypeevent flow-name xsl-region-after/a:anyTypecloseState static-content/a:anyTypeopenState static-content/a:anyTypeevent flow-name xsl-footnote-separator/a:anyTypecloseState static-content/a:anyTypeopenState flow/a:anyTypeevent flow-name xsl-region-body/a:anyTypecloseState flow/a:anyTypecloseState sequence/a:an yTypecloseState compile/a:anyTypeopenState format/a:anyTypeopenState sequence/a:anyTypeevent master-reference section_1/a:anyTypeopenState flow/a:anyTypeevent page-number 1/a:anyTypecloseState flow/a:anyTypeopenState static-content/a:anyTypecloseState static-content/a:anyTypecloseState sequence/a:anyTypecloseState format/a:anyTypeopenState generate/a:anyTypeevent output-format pdf/a:anyTypecloseState generate/a:anyTypeJVBERi0xLjUKJeLjz9MKNiAwIG9iago8PC9MZW5ndGggNyAwIFIKL0ZpbHRlciAvRmxhdGVEZWNvZGUKPj4Kc3RyZWFtCnjaC+Qq5DJQMFDIBZKGBgYKOVwgEsEC0RlQFTA+QgWMzuAKV8jjCuQCAEHUDr8KZW5kc3RyZWFtCmVuZG9iago3IDAgb2JqCjQ2CmVuZG9iago0IDAgb2JqC jw8L1Rpd GxlIChVbnRpdGxlZCkKL0NyZWF0b3IgKFVua25vd24pCi9BdXRob3IgKFVua25vd24pCi9Qcm9kdWNlciAoWEVQIDQuMjMpCi9UcmFwcGVkIC9GYWxzZQovQ3JlYXRpb25EYXRlIChEOjIwMTQxMTE4MDEzNDMxWikKL01vZERhdGUgKEQ6MjAxNDExMTgwMTM0MzFaKQo+PgplbmRvYmoKMSAwIG9iago8PC9U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DAwMDg4NSAwMDAwMCBuIAowMDAwMDAwMTUyIDAwMDAwIG4gCjAwMDAwMDA1NDEgMDAwMDAgbiAKMDAwMDAwMDAxNSAwMDAwMCBuIAowMDAwMDAwMTM0IDAwMDAwIG4gCjAwMDAwMDA3MjMgMDAwMDAgbiAKMDAwMDAwMDc1OSAwMDAwMCBuIAowMDAwMDAwODY2IDAwMDAwIG4gCnRyYWlsZXIKPDwvU2l6ZSAxMQovSW5mbyA0IDAgUgovUm9vdCAxIDAgUgovSURbPERENzk4MDRDN0NFODIyMjdERkNCQkQwOEQ4RUQ2NjcyPjxERDc5ODA0QzdDRTgyMjI3REZDQkJEMDhEOEVENjY3Mj5dCj4+CnN0YXJ0eHJlZgoxODM4CiUlRU9GCg==Success
— Reply to this email directly or view it on GitHub https://github.com/Xportability/css-to-pdf/issues/2 .Image removed by sender.