2012-01-18 193 views
4

我正在使用wkhtmltopdf(11.0_rc1)通過wicked_pdf寶石。我注意到多列布局不能很好地利用分頁符。wkhtmltopdf:分頁符和多列布局不起作用

我也注意到CentOS(在Heroku上)和Windows之間的行爲不一樣。在Windows中,分頁符在某些情況下可以使用。

你以前遇到過這樣的問題嗎?任何幫助,高度讚賞。

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
    <style type='text/css'> 
     .page { 
     page-break-after:always !important; 
     clear:both; 
     display:block; 
     } 

     #content { 
     width: 800px; 
     } 
    </style> 
    </head> 

    <body> 
    <div id="content"> 
     <div class="page"> 
     <div style="float:left;width:200px;"> 
      DESCRIPTION 1 
     </div> 

     <div style="float:left;"> 
      PIE CHART IMAGE 1 
     </div>   
     </div> 

     <div class="page"> 
     <div style="float:left;width:200px;"> 
      DESCRIPTION 2 
     </div> 

     <div style="float:left;"> 
      PIE CHART IMAGE 2 
     </div>   
     </div> 

     <div class="page"> 
     <div style="float:left;width:200px;"> 
      DESCRIPTION 3 
     </div> 

     <div style="float:left;"> 
      PIE CHART IMAGE 3 
     </div>   
     </div> 

    </div> 
    </body> 
</html> 

回答

0

你可以看到如何安裝patched version of QT

它爲我工作。並保持你的html儘可能簡單。

+0

鏈接及其相應的任何工作不會影響分頁符。我使用的是QT 4.8.4 wkhtmltopdf 0.11.0 wicked_pdf 0.9.4 – Trip 2013-06-25 16:10:24