dompdf

Custom Fonts for DOMPDF

纵然是瞬间 提交于 2019-11-28 17:32:52
问题 I'm Using DOM PDF 0.6.0 Beta 2. I want to use custom fonts (Fonts: 'Segeo Print', 'Lucida Handwriting','Airplanes in the Night Sky') in PDF file. I followed the guidelines to install and use fonts in my PHP Code, which is given here http://code.google.com/p/dompdf/wiki/CPDFUnicode But I'm not able to get desire fonts in my PDF. You can find my code in this post. Please Let me know how I can resolve this issue. <?php require_once("dompdf_config.inc.php"); $html = "<html> <head> <meta http

dompdf Page break if element is exceeding page height?

帅比萌擦擦* 提交于 2019-11-28 17:25:24
问题 What is the best way to do page breaks in dompdf? I have had a look here at the page-break-before css attribute, but it didn't work when I did: table {page-break-before:auto;} The page still breaks in the middle of my table. Is it possible to setup my html/css so that the page will break before the element if the element is going to exceed the page height? Ideally I would like to divide my html up in to div sections so that each section will start on a new page if it is going to exceed the

How to overlay HTML generated PDF on top of existing PDF?

强颜欢笑 提交于 2019-11-28 13:05:36
I'm looking to start with an initial PDF file, one that has graphics and text, and then take some html code which has dynamic values for some user input, generate that as a PDF, hopefully either using the initial PDF as a background, OR somehow running a PHP script afterwards to "merge" both PDF where one acts as a background to another. I have some code that renders an HTML formatted PDF: (using DOMPDF) $initialpdf = file_get_contents('file_html.html'); $initialpdf = str_replace(array( '%replaceText1%', '%replaceText2%' ), array ( $replaceText1, $replaceText2, ), $initialpdf); $fp = fopen(

DOMPDF, I cannot create two pdf at time

*爱你&永不变心* 提交于 2019-11-28 12:49:41
问题 When i try to create two pdf at a time it's throwing errors... Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'No block-level parent found. Not good.' in C:\wamp\www\si2i\application\libraries\dompdf\include\inline_positioner.cls.php on line 38 ( ! ) DOMPDF_Exception: No block-level parent found. Not good. in C:\wamp\www\si2i\application\libraries\dompdf\include\inline_positioner.cls.php on line 38 here is the code: $this->load->library('pdf'); $this->pdf->set_base_path($data

dompdf and img tag, image wont show

淺唱寂寞╮ 提交于 2019-11-28 07:47:29
问题 Here is the HTML just before $dompdf->render() and $dompdf->output() are called: <img src="http://www.example.com/images/Logo.png" /> All other invoices display the image fine when viewing in the browser, or printing it, or emailing it as HTML. When I click 'Generate PDF' inside of our application, it renders the invoice in PDF, except the logo is missing. I have put a debugging line in to email me the raw HTML it sends to the render(), and it looks fine to me. Does anyone have any idea why

DOMPDF problem with Cyrillic characters

橙三吉。 提交于 2019-11-28 07:02:00
I am using the DOMPDF library to create an invoice in PDF. This document can be in French, Russian or English, but I am having trouble printing Russian characters. First, I tried to use UTF-8 encoding and placed the meta tag in the head of the HTML page to be converted: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> But that didn't work. Then I inserted this meta tag inside the BODY tag, and it helped solve the problem with French characters. But Russian characters still don't work. I have also tried to convert Russian characters into HTML entities, but that too does not

DOM pdf codeigniter: Class 'DOMPDF' not found error

匆匆过客 提交于 2019-11-28 05:40:01
问题 I trying to add DOM PDF library to my codeigniter application 1.Download dompdf and copy the dompdf folder to libraries folder. 2.Create file named Dompdf.php in libraries folder In my controller public function pdf_test() { $this->load->library('Dompdf'); $this->Dompdf->loadHtml('hello world'); $this->pdf->render(); $this->pdf->stream("welcome.pdf"); } Dompdf.php <?php defined('BASEPATH') OR exit('No direct script access allowed'); /** * CodeIgniter PDF Library * * Generate PDF's in your

dompdf special characters

给你一囗甜甜゛ 提交于 2019-11-28 01:50:32
I'm having successful html-to-pdf conversions, but not with special characters. Below is just a special character I'm trying to display, which displays in browsers on my Mac, when I put it simply inside an html document. (but not on my windows box) <?php require_once("../dompdf_config.inc.php"); $html = '€'; $dompdf = new DOMPDF(); $html = iconv('UTF-8','Windows-1250',$html); $dompdf->load_html($html); $dompdf->render(); $dompdf->stream("contract.pdf"); exit(0); ?> I keep getting a "?" (question mark) when the pdf is rendered. I know there's been lots of issues documented with regards to

DOMPDF - attach created PDF to email

可紊 提交于 2019-11-27 22:20:16
What is the easiest way to attach a PDF to an email via DOMPDF? The end of my script I am using (part of it) is below: $dompdf = new DOMPDF(); $dompdf->load_html($html); $dompdf->render(); //below to save the pdf file - not needed if emailing pdf file_put_contents('/home/ststrave/public_html/pdf/STS_Brochure.pdf', $dompdf->output()); //below to open pdf in browser - required $dompdf->stream("STS_Brochure_".rand(10,1000).".pdf", array("Attachment" => false)); jexit(); Just for clarification - this is being used in Joomla. Appreciate the simplest/quickest way using standard PHP mail function.

PHP-font-lib must either be installed via composer or copied to lib/php-font-lib

纵然是瞬间 提交于 2019-11-27 20:04:12
i'm trying to convert some html to pdf. After some google search i find dompdf but when i try to convert i retrieve PHP-font-lib must either be installed via composer or copied to lib/php-font-lib This is what i'm trying to do: require 'pdf/dompdf.php'; $dompdf = new DOMPDF(); $dompdf->load_html($html); $dompdf->render(); $dompdf->stream("sample.pdf"); How can i solve? Thanks! Fabien Ménager Dompdf moved recently to Github , and we also added Composer support. For this, we removed the reference to the required external library php-font-lib . Note: If you are using composer to install dompdf