dompdf

dompdf: top-margin after page break not working

。_饼干妹妹 提交于 2019-12-11 04:40:50
问题 I'm experimenting with Wordpress and (the recent version of) dompdf at the moment and ran into an annoying problem regarding the formating. My Problem: The top-margin of the main content seems not to be considered on the second page generated, resulting in an overlapping with my logo. You can view the generated PDF under this link. The relevant code from which the PDF is generated reads as follows (it is not perfect yet as i want to resolve the issue first): function ppt_pdf_output() { //

DOMPDF images not showing on new server

时间秒杀一切 提交于 2019-12-11 04:35:56
问题 I've created an application which outputs a PDF report based on an HTML page using DOMPDF. This works fine on my test server, but when I've migrated it over to the live server, none of the images show in the PDF. It's not showing a RED X - just nothing there at all. I've checked that the new server meets the requirements using the config tool, and I've enabled the "leave images in temp" debugging option, and nothing is being created in the the temp directory. Any ideas what might have changed

How can I customize font and page in laravel dompdf?

萝らか妹 提交于 2019-12-11 04:25:50
问题 I get from here : https://github.com/barryvdh/laravel-dompdf My controller is like this : public function listdata() { $pdf=PDF::loadView('print_tests.test_pdf'); $pdf->setPaper('L', 'landscape'); return $pdf->stream('test_pdf.pdf'); } My view is like this : <script type="text/php"> if ( isset($pdf) ) { $x = 72; $y = 18; $text = "{PAGE_NUM} of {PAGE_COUNT}"; $font = $fontMetrics->get_font("Arial", "bold"); $size = 6; $color = array(0,0,0); $word_space = 0.0; // default $char_space = 0.0; //

dompdf : image not found or type unknown

北城以北 提交于 2019-12-11 04:16:25
问题 Here is my code, I mostly tried all the methods for displaying image on PDF but still didnt work. Could you please help me for this. I also set DOMPDF_ENABLE_REMOTE to true and still results is same. require_once("dompdf/autoload.inc.php"); //require('WriteHTML.php'); $html = '<body> <div id="watermark"><img src="/var/htdocs/PDF/header.png" height="100%" width="100%"></div> <div id="header"> <h3 style="padding-top:10px;">'.$_POST['name'].'</h3> </div> <div id="footer"> <h3 style="padding-top

Create PDF file with contents from the database

穿精又带淫゛_ 提交于 2019-12-11 03:40:39
问题 I would want to print tickets in pdf. I was already able to retrieve the ticket details like customer name, order id, order items, and total bill. I would want to put this details in the .pdf file ready for printing. I'm using html and php tags in retrieving these ticket details from the database. How can I convert to .pdf all items echoed in .php file? 回答1: You can use a library like dompdf. 回答2: I personally prefer TCPDF to create PDFs from PHP. It's still actively being developed and has a

Generate a PDF with background image without margin

泄露秘密 提交于 2019-12-11 03:05:19
问题 I want to generate a PDF with DOMPDF tool in CodeIgniter. I have an image and I want to display it in a background full DIN A4 PDF page, when I try to do this: body{ background-image: url('http://blogs.ucl.ac.uk/quantum/files/2013/12/artwork-fullsize.jpg'); background-position: bottom right; background-repeat: no-repeat; background-size: 100%; width:100%; height:100%; padding: 0px; margin: 0px; } I have a PDF but it appear a margin (or padding). I want without margin or padding, just a full

dompdf font family issue

半城伤御伤魂 提交于 2019-12-11 02:35:41
问题 I'm using Bamboo invoice as an invoice generator, and I'm trying to customize the invoice template, but no matter what I do, the font just won't seem to adjust. currently I have body { margin: 0.5in; font-family: 'helvetica'; font-size: 10pt;} I've read up on it, and helvetica is an installed font, so it should work to make sure I changed it to 'courier'; which is also in the lib/fonts directory, but the font remains the same. Any help? 回答1: Kinda late, but still applicable for google

DOM PDF generate only 1 page pdf skip remaining content

谁说胖子不能爱 提交于 2019-12-11 02:08:19
问题 I have the following code which uses DOM PDF Library for converting Html content to PDF file. $dompdf = new DOMPDF(); $dompdf->set_paper(array(0,0,450,306)); $dompdf->load_html($html); $dompdf->render(); $output = $dompdf->output(); file_put_contents($pdf_path, $output); But it generates 2-3 pages based on the html content. I wanted to limit it to single page only and skip the remaining content. 回答1: The easiest way is to render to image. The GD adapter allows you to specify the page you want

Generating a PDF using CodeIgniter

可紊 提交于 2019-12-11 01:28:13
问题 I am using dompdf to create a pdf file out of an html file that gets created on-the-fly for the sole purpose of it serving as input for the pdf generator, however I am having trouble doing this, I implemented the code in this thread and everything works fine (I could output a simple pdf) however when I try to give it a more specific url I get this error: An Error Was Encountered Unable to load the requested file here's the code that has the problem: function printPDF(){ //write_file() usa un

dompdf: white margin on A4 page

萝らか妹 提交于 2019-12-11 01:02:23
问题 I am using dompdf (a PHP library) to create a PDF page and I have a problem to set proper dimensions. When I use CSS property: @page { size: 21cm 29.7cm; } … and for example I want to have the upper part of the page in red color, the PDF file is OK, but after print I got white margin. How can I fix it? 回答1: You've set the size of the page, but not the content boundaries. If you don't want any border on the page you have to set the page margins to 0. @page { size: 21cm 29.7cm; margin: 0; }