dompdf

Create PDF with DOMPDF and Redirect

て烟熏妆下的殇ゞ 提交于 2019-12-02 07:52:14
In a PHP project I need to Create a PDF file and redirect to another page when user clicks a Submit button. I have managed to create the pdf file using DOMPDF . PDF creation is done in a seperate file ('PDFRecipt.php') . I have called that page when a user clicks a button on the main page. This is how call PDF page header('location:PDFRecipt.php'); but the problem is when I try to redirect after calling PDF page by header('location:Other.php'); It does not create the PDF (only redirects). I tried changing header('location:PDFRecipt.php'); to include_once('PDFRecipt.php'); then it does not

convert html file to pdf using dompdf

跟風遠走 提交于 2019-12-02 05:05:02
How do I properly use dompdf to convert html files into pdf. I'm doing something like this: <?php require_once("lib/dompdf/dompdf_config.inc.php"); $file = "checkout.html"; $dompdf = new DOMPDF(); $dompdf->load_html_file($file); $dompdf->render(); $dompdf->stream("sample.pdf"); ?> But I get this error: Fatal error: Call to undefined method Inline_Frame_Decorator::normalise() in C:\wamp\www\pos\php\lib\dompdf\include\table_frame_decorator.cls.php on line 252 How do I solve this, please enlighten me. Thanks. Update Here are the contents of checkout.html <table border="0"> <th colspan="10"

PHPWord to PDF not able to load library

半腔热情 提交于 2019-12-02 01:45:01
I have been trying all day to get this to work. Right now I am able to save the document as .docx file but I wanted to be able to save the document as PDF I have tried with DOMPDF and TCPDF but I keep getting error 'Unable to load PDF Library' I confirmed the path is correct. Am I missing something? thank you for your help $rendererName = \PhpOffice\PhpWord\Settings::PDF_RENDERER_TCPDF; $rendererLibrary = 'tcpdf.php'; $rendererLibraryPath = dirname(__FILE__) .'/plugins/tcpdf/' . $rendererLibrary; \PhpOffice\PhpWord\Settings::setPdfRenderer($rendererName,$rendererLibraryPath); $document->saveAs

ErrorException in Cpdf.php line 3855: Undefined index: at barryvdh/laravel-dompdf

扶醉桌前 提交于 2019-12-02 00:29:52
问题 I am using laravel 5.2, The dompdf runs fine at localhost but when moved to AWS it keeps showing ErrorException in Cpdf.php line 3855: Undefined index: , in this line (3855) has font variable. Sample code : $html = "<h2>Hello</h2>"; PDF::setOptions(['dpi' => 150, 'defaultFont' => 'sans-serif']); $pdf = PDF::loadHTML($html)->setPaper('a4', 'landscape'); return $pdf->download('pdfview.pdf'); I can not set 'currentFont' => 'sans-serif' at setOptions due to no options in barryvdh/laravel-dompdf.

What PDF meta data does dompdf support?

狂风中的少年 提交于 2019-12-01 23:31:10
问题 When using dompdf what PDF meta data can be set in the document information dictionary? Originally asked elsewhere: Are you able to parse more META info to be added to PDF information during PDF generation? /Creator (DOMPDF) /CreationDate (D:20150818031116-05'00') /ModDate (D:20150818031116-05'00') Can you specify Author, Copyright, etc..? I cannot find ANY reference to this. Only just saw your: Creator, Creation Date and Modification Date! 回答1: In the current stable release (0.6.1) the HTML

how to convert multiple html files with Dompdf?

眉间皱痕 提交于 2019-12-01 21:31:25
What I am Doing: I am using a PHP library called Dompdf to convert my HTML file into PDF. I have successful converted a single HTML file to PDF. What I am trying to do: Now I have multiple reports I want to convert them into PDF file. What I am doing: I have a example here in which I'm a getting a form from database and another one by direct from view. Code: $result['patients'] = $this->reports_model->get_xray_reports($id); // getting form from database require_once "dompdf/dompdf_config.inc.php"; // include dompdf $dompdf = new DOMPDF(); $dompdf->set_paper("A4"); $html = $this->load->view(

DomPDF generation for chinese characters

巧了我就是萌 提交于 2019-12-01 19:37:07
I am trying to generate a PDF that will contain Chinese characters using dompdf. Here is my code: require('dompdf/dompdf_config.inc.php'); $dompdf = new DOMPDF(); mb_internal_encoding('UTF-8'); def("DOMPDF_UNICODE_ENABLED", true); $html = ' <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <style> *{ font-family: DejaVu Sans, font-size: 12px;} </style> </head> <body> 忠烈祠 </body> </html>'; $dompdf->load_html($html); $dompdf->render(); $output = $dompdf->output(); $filename = 'a.pdf'; $path = $filename; file_put_contents($path, $output); The problem is the the

DomPDF generation for chinese characters

廉价感情. 提交于 2019-12-01 19:37:03
问题 I am trying to generate a PDF that will contain Chinese characters using dompdf. Here is my code: require('dompdf/dompdf_config.inc.php'); $dompdf = new DOMPDF(); mb_internal_encoding('UTF-8'); def("DOMPDF_UNICODE_ENABLED", true); $html = ' <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <style> *{ font-family: DejaVu Sans, font-size: 12px;} </style> </head> <body> 忠烈祠 </body> </html>'; $dompdf->load_html($html); $dompdf->render(); $output = $dompdf->output(

How to include the external style sheet in dom pdf

主宰稳场 提交于 2019-12-01 17:40:53
I am using Dompdf for the report generation in the php. I am not able to include the external style sheet for the same... The code I am using is similar to the following: <?php require_once "dompdf/dompdf_config.inc.php"; $dompdf = new DOMPDF(); $html =" <table> <tr > <td class='abc'>testing table</td> </tr> <tr> <td class='def'>Testng header</td> </tr> </table>"; $dompdf->load_html($html); $dompdf->render(); $dompdf->set_base_path('localhost/exampls/style.css'); $dompdf->stream("hello.pdf"); ?> Please let me know how to include the external css file.. $dompdf->set_base_path() isn't where you

error in pdf image using dompdf

陌路散爱 提交于 2019-12-01 14:23:56
I have to display a logo in every page of a generated PDF. Though it works fine in the local system, it throws following exception in the server: Fatal error: Uncaught exception 'PDFlibException' with message 'Handle parameter or option of type 'image' has bad value 0' in /var/www/dev/subdomains/rfqms/httpdocs/sprintnineteen/system/plugins/dompdf/include/pdflib_adapter.cls.php:664 Stack trace: #0 /var/www/dev/subdomains/rfqms/httpdocs/sprintnineteen/system/plugins/dompdf/include/pdflib_adapter.cls.php(664): PDFlib->fit_image(0, 30, 746, 'boxsize={86 43}...') #1 /var/www/dev/subdomains/rfqms