dompdf

dompdf memory issues

别说谁变了你拦得住时间么 提交于 2019-12-22 10:46:21
问题 I'm using DOMPDF to generate about 500 reports from one script. It's running out of memory after about 10-15 PDFs have been generated. In debugging, it looks like it's loading 8M every time it gets to the font loading stuff, but this seems like something that should be handled with the font caching code. Any ideas of what's going wrong here? I'd like to post a simple code snippet, but most of it is abstracted into multiple layers, so it's not just a simple copy/paste. 回答1: First if this is

how to fix Undefined variable: collaborators in domPDF in Laravel [duplicate]

白昼怎懂夜的黑 提交于 2019-12-20 05:51:13
问题 This question already has answers here : “Notice: Undefined variable”, “Notice: Undefined index”, and “Notice: Undefined offset” using PHP (28 answers) Closed 3 years ago . I am going to print PDF using domPDF. this is My CollaboPDFController.php: <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use App\Http\Controllers\Controller; use PDF; use App\Collaboration; class CollaboPDFController extends Controller { public function getPDF(){ $collaborators =

How can I not display page number = 1 in pdf ? (hmtl css)

北城以北 提交于 2019-12-20 04:54:19
问题 My code html like this : <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Print PDF</title> <style type="text/css"> .footer { position: fixed; left: 0px; right: 0px; height: 50px;text-align: center; } .footer .pagenum:before { content: counter(page); } </style> </head> <body> <h1>This is test</h1> <table class="tg"> <tr> <th class="tg-3wr7">kolom 1</th> <th class="tg-3wr7">kolom 2</th> <th class="tg-3wr7">kolom 3</th> <th class="tg-3wr7

Including style sheets in a PDF in cakePHP

半世苍凉 提交于 2019-12-20 03:54:18
问题 I am using dompdf to generate PDFs for some of the views and that is working just fine. The problem is that I cannot include the css files anywhere, and only css included in the <style> tags inside the view itself is taken into consideration. Here is the controller action: public function view_pdf($id=null){ ini_set('memory_limit','512M'); $event = $this->Event->findById($id); $evt_data=new \DateTime($event['Event']['date']); $this->set('event', $event); $this->layout='event'; } Here is the

PHPWord to PDF not able to load library

六眼飞鱼酱① 提交于 2019-12-20 03:47:10
问题 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/' .

dompdf: How to add header on every page except first?

我怕爱的太早我们不能终老 提交于 2019-12-19 19:52:13
问题 I'm using dompdf to generate a PDF. I've grabbed the code from the dompdf website to add a Header to the pdf and it's working, but I would like to put the header on every page except for the first. Any suggestions? 回答1: You can do this by inserting the header and footer elements after the elements that appear in the first page. For example : <style> .flyleaf { page-break-after: always; } .header, .footer { position: fixed; } .header { top: 0; } .footer { bottom: 0; } </style> <div class=

dompdf: How to add header on every page except first?

荒凉一梦 提交于 2019-12-19 19:51:27
问题 I'm using dompdf to generate a PDF. I've grabbed the code from the dompdf website to add a Header to the pdf and it's working, but I would like to put the header on every page except for the first. Any suggestions? 回答1: You can do this by inserting the header and footer elements after the elements that appear in the first page. For example : <style> .flyleaf { page-break-after: always; } .header, .footer { position: fixed; } .header { top: 0; } .footer { bottom: 0; } </style> <div class=

dompdf: loading html files to render, doesn't work

家住魔仙堡 提交于 2019-12-19 07:44:42
问题 dompdf is not able to generate a pdf from a page of my website. However, I've saved the page and uploaded it as simple static html file, and it worked! So, I don't know if the issue is with the url, or something else.. this is the error I get: Warning: require_once(/home/o110334/public_html/dompdf/include/firephp.cls.php) [function.require-once]: failed to open stream: No such file or directory in /home/o110334/public_html/dompdf/dompdf_config.inc.php on line 194 Fatal error: require_once()

dompdf fails to load

谁都会走 提交于 2019-12-18 11:47:27
问题 I am trying to get dompdf running on an in-house server. With the default config.inc.php settings, I get the following when running the equivalent of the demo 'Hello Wolrd' script: Warning: require_once(/var/www/dompdf-master/lib/php-font-lib/classes/font.cls.php): failed to open stream: No such file or directory in /var/www/dompdf-master/dompdf_config.inc.php on line 335 Fatal error: require_once(): Failed opening required '/var/www/dompdf-master/lib/php-font-lib/classes/font.cls.php'

DOMPDF loadView() error - undefined variable: data

不问归期 提交于 2019-12-18 07:55:31
问题 I'm currently trying to incorporate the DOMPDF Wrapper for Laravel into my project, however I'm having troble figuring out how to pass a variable into the PDF template. As per the instructions, in my controller I have: //PrintController.php $data = array('name'=>'John Smith', 'date'=>'1/29/15'); $pdf = PDF::loadView('contract', $data); return $pdf->stream('temp.pdf'); and in my view: //contract.php ... <p><?php echo $data->name ?><p> <p>Signature</p> But when I try to render the page, I get