Note that there are some explanatory texts on larger screens.

plurals
  1. POPhantomjs page-break-after: always creating spaces
    primarykey
    data
    text
    <p>i am facing problem with phantomjs(html to pdf) ,i have 1 html page which have 16 div and i was willing to add page break on each,but when i add page-break-after: always on each div then in pdf its creating alot of spaces,suppose when i add space on 2 div and rest on is with out page break then spaces are little bit but when add spaces 3,4,5 etc then spaces are adding more means each page has alot of spaces,how i can resolve this,thanks in advance.</p> <p>here is my code</p> <pre><code>fs.readFile(__dirname + '/../pdf' + pdfpath, 'utf8', function (err, data) { // Render the page to variable. var html = ejs.render(data, pdfJSON); // Set this html as the content for the pdf file. page.set('content', html); var fileName = __dirname + '/pdfdata/' + f.formType + f.formId + '.pdf'; // Generate the pdf. page.render(fileName); }); </code></pre> <p>and here is my html page code</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;PreQual PDF Export&lt;/title&gt; &lt;style type="text/css"&gt; &lt;!-- body { font-family: Arial; font-size: 33.0px } .pos { position: absolute; z-index: 0; left: 0px; top: 0px } .set-top{ top: 20px;} --&gt; &lt;/style&gt; &lt;/head&gt; &lt;body &gt; &lt;nobr&gt; &lt;nowrap&gt; &lt;div class="set-top" style="page-break-after: always;position:relative;left:50%;margin-left:-398px;width:928px;height:1170px;overflow:hidden"&gt; &lt;div style="position:absolute;left:0px;top:0px"&gt; &lt;img name="_1170:828" src="&lt;%= baseUrl %&gt;/pdf/prequal/page_001.jpg" height="1170" width="828" border="0" usemap="#Map"&gt; &lt;/div&gt; &lt;div class="pos" id="_126:284" style="top:284;left:126"&gt; &lt;span id="_30.8" style=" font-family:Arial; font-size:30.8px; color:#fdfffd"&gt; Prequal Documents for the&lt;/span&gt; &lt;/div&gt; &lt;div class="pos" id="_126:323" style="top:323;left:126"&gt; &lt;span id="_30.8" style=" font-family:Arial; font-size:30.8px; color:#fdfffd"&gt; procurement of Goods&lt;/span&gt; &lt;/div&gt; &lt;div class="pos" id="_138:975" style="top:975;left:138"&gt; &lt;span id="_15.4" style="font-weight:bold; font-family:Arial; font-size: 14px; color:#fdfffd"&gt; SAQ Return Date:&lt;span&gt;&lt;%= saqDate %&gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="pos" id="_492:975" style="top:975;left:492"&gt; &lt;span id="_15.4" style="font-weight:bold; font-family:Arial; font-size: 14px; color:#fdfffd"&gt; Project Reference No. TCD&lt;%= refNo %&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="pos" id="_136:1092" style="top:1092;left:136"&gt; &lt;span id="_13.6" style="font-style:italic; font-family:Palatino Linotype; font-size:13.6px; color:#000000;"&gt; &lt;img name="_1170:829" src="&lt;%= baseUrl %&gt;/providers/public/files/&lt;%= file1 %&gt;" height="50" width="50" border="0" style="left:10px;" alt="No Image"/&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="pos" id="_267:1095" style="top:1095;left:267"&gt; &lt;span id="_13.6" style="font-weight:bold;font-style:italic; font-family:Palatino Linotype; font-size:13.6px; color:#000000;"&gt; &lt;img name="_1170:829" src="&lt;%= baseUrl %&gt;/providers/public/files/&lt;%= file2 %&gt;" height="50" width="50" border="0" style="left:10px;" alt="No Image"/&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="pos" id="_369:1095" style="top:1095;left:369"&gt; &lt;span id="_13.6" style="font-weight:bold;font-style:italic; font-family:Palatino Linotype; font-size:13.6px; color:#000000;"&gt; &lt;img name="_1170:829" src="&lt;%= baseUrl %&gt;/providers/public/files/&lt;%= file3 %&gt;" height="50" width="50" border="0" style="left:10px;" alt="No Image"/&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="pos" id="_480:1093" style="top:1093;left:480"&gt; &lt;span id="_13.6" style="font-weight:bold;font-style:italic; font-family:Palatino Linotype; font-size:13.6px; color:#000000;"&gt; &lt;img name="_1170:829" src="&lt;%= baseUrl %&gt;/providers/public/files/&lt;%= file4 %&gt;" height="50" width="50" border="0" style="left:10px;" alt="No Image"/&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="pos" id="_609:1094" style="top:1094;left:609"&gt; &lt;span id="_13.6" style="font-weight:bold;font-style:italic; font-family:Palatino Linotype; font-size:13.6px; color:#000000;"&gt; &lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- Page No 2 --&gt; &lt;div class="set-top" style="page-break-after: always;position:relative;left:50%;margin-left:-398px;width:928px;height:1170px;overflow:hidden"&gt; &lt;div class="pos" id="_0:0" style="top:0"&gt; &lt;img name="_1170:827" src="&lt;%= baseUrl %&gt;/pdf/prequal/page_002.jpg" height="1170" width="827" border="0" usemap="#Map"&gt;&lt;/div&gt; &lt;div class="pos" id="_157:1357" style="top:200;left:157"&gt; &lt;span id="_24.5" style=" font-family:Arial; font-size:24.5px; color:#61c5c5"&gt; Contents&lt;/span&gt; &lt;/div&gt; &lt;div class="pos" id="_414:1348" style="top:200;left:414"&gt; &lt;span id="_24.5" style=" font-family:Arial; font-size:24.5px; color:#fcfcfc"&gt; Part 01&lt;/span&gt; &lt;/div&gt; &lt;div class="pos" id="_414:1392" style="top:240;left:414"&gt; &lt;span id="_15.0" style="font-weight:bold; font-family:Arial; font-size:15.0px; color:#000000;"&gt; INTRODUCTION&lt;/span&gt; &lt;/div&gt; &lt;div class="pos" id="_154:1560" style="top:400;left:154"&gt; &lt;span id="_24.5" style=" font-family:Arial; font-size:24.5px; color:#fcfcfc"&gt; Part 02&lt;/span&gt; &lt;/div&gt; &lt;div class="pos" id="_414:1569" style="top:400;left:414"&gt; &lt;span id="_24.5" style=" font-family:Arial; font-size:24.5px; color:#fcfcfc"&gt; Part 03&lt;/span&gt; &lt;/div&gt; &lt;div class="pos" id="_154:1597" style="top:440;left:154"&gt; &lt;span id="_15.0" style="font-weight:bold; font-family:Arial; font-size:15.0px; color:#000000;"&gt; PASS / FAIL&lt;/span&gt; &lt;/div&gt; &lt;div class="pos" id="_154:1615" style="top:460;left:154"&gt; &lt;span id="_15.0" style="font-weight:bold; font-family:Arial; font-size:15.0px; color:#000000;"&gt; REQUIREMENTS&lt;/span&gt; &lt;/div&gt; &lt;div class="pos" id="_414:1607" style="top:440;left:414"&gt; &lt;span id="_15.0" style="font-weight:bold; font-family:Arial; font-size:15.0px; color:#000000;"&gt; SELECTION CRITERIA&lt;/span&gt; &lt;/div&gt; &lt;/div&gt;&lt;/nowrap&gt;&lt;/nobr&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload