Category : dompdf

After many tries and and researches, I still can’t get the header and footer of my docx file after the conversion to PDF. I read many topics and looked at the issue on the github forum but didn’t find what I needed. I also tried with TCPDF and same result. $domPdfPath = base_path(‘vendor/dompdf/dompdf’); Settings::setPdfRendererPath($domPdfPath); Settings::setPdfRendererName(‘DomPDF’); ..

Read more

I would like to convert a complex word doc into PDF but face the following issues. If anyone has any suggestions or alternatives to phpword. Existing word doc has multiple pages with different styles and formattings. I tried using phpword to replace variables with data, but unable to add html tags/code, E.g. <ul><li>code</li><ul>, this turns ..

Read more

I have a view welcome.blade.php with the headear like this: <!DOCTYPE html> <html lang="{{ str_replace(‘_’, ‘-‘, app()->getLocale()) }}"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Blog</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <link href="{{ asset(‘css/app.css’) }}" rel="stylesheet" media="print"> <link href="{{ asset(‘css/example.css’) }}" rel="stylesheet" media="print"> <link rel="preconnect" href="https://fonts.gstatic.com"> </head> <body class="font-sans antialiased w-full"> …. I’m using tailwindcss, this page has ..

Read more

I’m trying to use font awesome in dompdf/laravel but no matter what I try the icons don’t show up, I’ve seen a bunch threads with similar or the same issue and their answers don’t work for me. I have included all the styles related fonts in internal styles @font-face { font-family: "FontAwesomeRegular"; font-weight: normal; font-style ..

Read more

<?php namespace AppHttpControllersAdmin; use AppHttpControllersController; use AppModelsFollowReport; use AppModelsMatchDetail; use AppModelsMatche; use AppModelsPoints; use HighlightAutoloader; use IlluminateHttpRequest; use IlluminateSupportFacadesAuth; use InterventionImageFacadesImage; use PDF; class MatchDetailController extends Controller { public function downlaodReport($id) { $match = Matche::findOrFail($id); $won= $this->getFinalResult($id); $view=”; $customPaper = ”; switch ($_GET[‘name’]) { case ‘omr’: $view = ‘admin/ReportsPdf/report-pdf’; $customPaper = array(0, 0, 1200, 2000); ..

Read more

I want to create multiple pages, but each one with diferent orientation 1st page -> Potrait 2nd page -> Landscape 3rd page -> Potrait 4th page -> Potrait …. With TCPDF will be easy to solve $pdf = new TCPDF(‘P’, PDF_UNIT, ‘LETTER’, true, ‘UTF-8’, false); // create PDF $pdf->AddPage(‘L’, PDF_UNIT, ‘LETTER’, true, ‘UTF-8’, false); // ..

Read more

I am trying to place an image in pdf but it shows an error: ‘Image not found or type unknown’ Code in the controller: public function generatePDF(Report $report){ $date = date(‘m/d/Y h:i:s a’, time()); $pdf = PDF::loadView(‘frontend.agencies.reportPDF’, compact(‘report’)); return $pdf->download(‘report – ‘ . $date . ‘.pdf’); } In the view: … <img src="{{ asset(‘storage/reports/’ . ..

Read more

I’ve been trying to get the PDF of a view using DOMPDF with a table full of ingredients populated from a database table. I created a function in my Controller: public function createPDF() { // retreive all records from db $data = Ingredients::all(); // share data to view view()->share(‘ingredients’, $data); $pdf = PDF::loadView(‘printableingredientslist’, $data); // ..

Read more

I implemented the laraveldaily invoice package, but recently I’ve had issues generating PDFs and I get the following error: [2021-07-16 21:46:31] .ERROR: file_put_contents(/tmp/log.htm): failed to open stream: Permission denied {"exception":"[object] (ErrorException(code: 0): file_put_contents(/tmp/log.htm): failed to open stream: Permission denied at /path/to/my/laravel/project/vendor/dompdf/dompdf/src/Dompdf.php:880) [stacktrace] So the first thing I did was I went into vendor and edited ..

Read more

Good night, I have an HTML that has a logo (image). When I give a return view, I view the page normally: $pdf = PDF::loadView(‘pdf.pdf’, array_merge($request->all(),[‘logo’=>$baseImage])); view(‘pdf.pdf’, array_merge($request->all(),[‘logo’=>$baseImage])); However, when I change the second line it generates the pdf, but without the logo: return $pdf->stream(‘teste.pdf’, array_merge($request->all(),[‘logo’=>$baseImage])); Sourc..

Read more