dompdf

how to save DOMPDF generated content to file? [closed]

岁酱吖の 提交于 2019-11-26 19:22:20
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I am using Dompdf to create PDF file but I don't know why it doesn't save the created PDF to server. Any ideas? require_once("./pdf/dompdf_config.inc.php"); $html = '<html><body>'. '<p>Put your html here, or generate it with your favourite '. 'templating system.</p>'. '</body></html>'; $dompdf = new DOMPDF();

Displaying pdf from arraybuffer

亡梦爱人 提交于 2019-11-26 16:34:33
I am returning stream data from laravel dompdf from this code $pdf = \App::make('dompdf.wrapper'); $pdf->loadHTML("<div>This is test</div>"); return $pdf->stream(); And this is my JS ajax code $.ajax({ type:"GET", url: "/display", responseType: 'arraybuffer' }).done(function( response ) { var blob = new Blob([response.data], {type: 'application/pdf'}); var pdfurl = window.URL.createObjectURL(blob)+"#view=FitW"; $("#pdfviewer").attr("data",pdfurl); }); Here is HTML to display pdf after ajax <object id="pdfviewer" data="/files/sample.pdf" type="application/pdf" style="width:100%;height:500px;"><

dompdf character encoding UTF-8

泄露秘密 提交于 2019-11-26 14:36:02
问题 Im trying to create pdf with correct characters, but there are "?" chars. I created a test php file, where Im trying to fing the best solution. If Im open in the browser the html I looks like ok UTF-8 --> UTF-8 : X Ponuka číslo € černý Češký But when I look into the pdf I see this UTF-8 --> UTF-8 : X Ponuka ?íslo € ?erný ?ešký Here is my all code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>č s š Š</title> </head> <body> <?php require_once("dompdf

Dompdf and set different font-family

好久不见. 提交于 2019-11-26 13:47:16
When generating a PDF it totally ignores my font-family attribute applied to my CSS. Instead of say Verdana , it uses Times New Roman. So my CSS look like: .sub-header { font-size: 1.4rem; text-transform: uppercase; font-family: NeutraText-Book !important; padding-bottom: 1.5rem; } The PDF is generated like this: $pdf = PDF::loadHTML($view); return $pdf->stream(); How can I set a font I want? BrianS PDF documents internally support the following fonts: Helvetica, Times-Roman, Courier, Zapf-Dingbats, & Symbol (all using Windows ANSI encoding). dompdf will embed any referenced font in the PDF so

Generating PDFs with PHP [closed]

荒凉一梦 提交于 2019-11-26 12:43:45
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I have a PHP application and a need to generate a PDF with the result of query. The easiest way a found to do this was to use the DOMPDF to generate the PDF for me. So a made a function that generates the HTML for me then a pass this to DOMPDF. In the development and testing

How to get page number on dompdf PDF when using “view”

隐身守侯 提交于 2019-11-26 09:54:50
问题 Ok, so I use the following snippet to get \"views\" of HTML with PHP variables loaded in as $data so that I can do things like fill in tr \'s of data from a database call or whatever. function getView ($file, $data=NULL) { if (!empty($data)) extract($data); ob_start(); if (is_file($file)) include($file); return ob_get_clean(); } Gets used for something like, $htmlPDF = getView(\'receipt.php\', array( \'orderNumber\' => $orderNumber )); Where $orderNumber is then used in the HTML to fill in it

Displaying pdf from arraybuffer

牧云@^-^@ 提交于 2019-11-26 04:51:38
问题 I am returning stream data from laravel dompdf from this code $pdf = \\App::make(\'dompdf.wrapper\'); $pdf->loadHTML(\"<div>This is test</div>\"); return $pdf->stream(); And this is my JS ajax code $.ajax({ type:\"GET\", url: \"/display\", responseType: \'arraybuffer\' }).done(function( response ) { var blob = new Blob([response.data], {type: \'application/pdf\'}); var pdfurl = window.URL.createObjectURL(blob)+\"#view=FitW\"; $(\"#pdfviewer\").attr(\"data\",pdfurl); }); Here is HTML to

Dompdf and set different font-family

自古美人都是妖i 提交于 2019-11-26 03:44:38
问题 When generating a PDF it totally ignores my font-family attribute applied to my CSS. Instead of say Verdana , it uses Times New Roman. So my CSS look like: .sub-header { font-size: 1.4rem; text-transform: uppercase; font-family: NeutraText-Book !important; padding-bottom: 1.5rem; } The PDF is generated like this: $pdf = PDF::loadHTML($view); return $pdf->stream(); How can I set a font I want? 回答1: PDF documents internally support the following fonts: Helvetica, Times-Roman, Courier, Zapf