2017-08-24 54 views
5

wkhtmltopdf phpwrapper ile temel bir pdf oluşturmaya çalışıyorum. Ben de yii çerçevesini kullanıyorum. wktmltopdf içindewkhtmltopdf ContentNotFoundError, code 1

<!doctype html> 
<html> 
    <head> 
    </head> 

    <body> 
      <p>test</p> 
    </body> 
</html> 

Ayarlarım:

$pdfParams = array(

      'header-html' => $this->tmpHeaderFile->getFileName(), 
      'footer-html' => $this->tmpFooterFile->getFileName(), 

      'username' => 'myUser', 
      'password' => 'myPass', 
     ); 
$this->pdf = new Pdf($pdfParams); 

hata im alma: sorunun ne

Exception 'Exception' with message 'Could not create PDF: Loading pages (1/6) 
[>               ] 0% 
[======>              ] 10% 
[==============================>        ] 50% 
[============================================================] 100% 
Counting pages (2/6)            
[============================================================] Object 1 of 1 
Resolving links (4/6)              
[============================================================] Object 1 of 1 
Loading headers and footers (5/6)           
[===>              ] 5% 
[======>              ] 10% 
[======>              ] 10% 
[=======>             ] 13% 
[==========>             ] 17% 
[==================================>       ] 57% 
[====================================>      ] 61% 
Warning: Failed to load https://work.mydomain.com/devs/florian/web//devs/florian/web/themes/css/report-footer.css (ignore) 
[============================================================] 100% 
Printing pages (6/6)            
[>               ] Preparing 
[============================================================] Page 1 of 1 
Done                  
Exit with code 1 due to network error: ContentNotFoundError' 

konusunda fikrin

Bu benim HTML'dir?

cevap

0

Daha önce benzer sorunlarla karşılaştım. Wkhtmltopdf ile çalışırken, tüm statik varlıklarınızın HTML dosyasına eklendiğinden emin olmanız gerekir.

Örneğin

: yanı HTML dosyasına doğrudan komut dosyası eklemek javascript dosyaları için

<!doctype html> 
<html> 
    <head> 
     <style> 
      html { 
       margin: 0; 
      } 
     </style> 
    </head> 

    <body> 
      <p>test</p> 
    </body> 
</html> 

: CSS dosyaları, iç stil sayfalarını kullanırlar.

<!doctype html> 
<html> 
    <head> 
     <script type="text/javascript"> 
      var body = document.querySelector('body'); 
     </script> 
    </head> 

    <body> 
      <p>test</p> 
    </body> 
</html> 

Bu

+0

çok teşekkürler bana yardımcı olur umarım –