0

i was trying to print invoice with Laravel using barryvdh/laravel-dompdf

I used the following code to convert pdf:

$pdf = \PDF::loadView('print.service_x')->setPaper('a4','portrait');
return $pdf->download('invoice.pdf'); 

But the style got break...some of the text overlap the table. How do i solve this problem?

enter image description here Style link is OK...As when i load the page without pdf it shows me correct view:

Hiren Gohel
  • 4,942
  • 6
  • 29
  • 48
User57
  • 2,453
  • 14
  • 36
  • 72
  • seems that you are using compound table heading. It not worked correctly... – omadonex Jun 27 '17 at 08:40
  • thing is dompdf is not perfect, in most cases you have to modify your html and css and make sure you use only the features that are supported "Handles most CSS 2.1 and a few CSS3 properties" – scx Jun 27 '17 at 08:56
  • Create simple `table` structure with simple styles: `` Then it's works! Refer this link: http://itsolutionstuff.com/post/laravel-5-generate-pdf-from-html-view-file-and-download-using-dompdfexample.html – Hiren Gohel Jun 27 '17 at 08:56

0 Answers0