Questions About dompdf

PHP: Automatically Saving a dynamic PDF to the remote server using DOMPDF

I am using the dompdf library to create my table based PDF and I can view it online or I can have it download to the users folder of choice.

But what I would like to do is have it save it to the remote server( i dont need it to be save to the users PC), like an automatically upload script that would create the file then upload it to the remote server, so i can then use it within my application later on.

is it possible to point the $_FILES["file"] script say so fetch the php page that creates the pdf and it then uploads it from there.

How to create several pages with dompdf

I am having some trouble with multidimensional array and its value.

What i am looking for is , from my query I am searching teachers name in the array. And after that i want to create a pdf using dompdf. The problem is with looping. I am not able to create a proper loop which will work the way I want it to work. My sample query is

    $q11 = "select id from teachers order by teacher ";
    $r11 = mysql_query($q11) or die(mysql_error());
    while($rows11 = mysql_fetch_array($r11)){
        $teacher = $rows11['id'];
        $dompdf->"It will start working";

Now i know , this code is confusing, but what i want is, it should create dompdf for every teacher in one single pdf file. Like from the query it should fetch teachers, and for each teacher it should create a dompdf page. Currently it is making just one page according to the last value that my query has search.

Please help. It is kinda urgent.

Adding Header and Footer with page number in dompdf

Hi i am working on codeigniter framwork and i successfully implemented dompdf for generating pdf files . now i have a issues on adding Header and footer in generated pdf so please help me to solve this issue

here is the my dompdf_helper code

$dompdf = new DOMPDF();
if ($stream) {
} else {
    return $dompdf->output();

?> here is the my controller to call pdf generation

$this->load->helper(array('dompdf', 'file'));
$html = $this->load->view('store/sales_pdf', $data, true);
$html.= $this->load->view('footer');
pdf_create($html, $filename);
$data = pdf_create($html, '', false);
write_file('name', $data); 

and i use the script for getting page no but it printed only if second page is exits otherwise wont

dompdf and codeigniter - error 500 when execute load_html

I have an error 500 with this code:

require_once FCPATH.'application/helpers/dompdf/';
$dompdf = new DOMPDF();
$dompdf->load_html( $html );
$pdf = $dompdf->output();
file_put_contents( './tmp/'.$filename.'.pdf' , $pdf );

With some debug, I find that the "evil" code is this

$dompdf->load_html( $html );

And I don't know how to solve this.

Even the "ini_set" instruction with memory_limit and max_execution_time doesn't fix this problem..

(PHP) Are overlapping images possible in PDFs generated by TCPDF or domPDF?

We need two images to overlap. The one image is of a plug, and the other is of a cable. Placing them side-by-side isn't good enough because the plug has a curved edge, and so the cable doesn't appear to be connected to the plug due to the white space between the plug's curved edge and the cable's edge.

Now when rendering this effect in HTML on the browser, we use overlapping divs, which are easy to implement using fixed positions / negative margins / etc. Thus in order to make the two images look connected, we've given the plug image a transparent background, and have placed it over the image of the underlying cable.

However we need to achieve the same effect in a PDF report, and we haven't been able to find a way to overlap two images in HTML rendered in PDFs generated by TCPDF. We've also tried domPDF without luck.

Perhaps one of you TCPDF / domPDF gurus out there have a solution? We're also open to out-of-the-box solutions that achieve the desired effect.

dompdf ignores width attribute

I am trying to create a PDF that has three black boxes across the page. I have coded up the following..


  $html =
  <!DOCTYPE html>
  <meta charset="utf-8" />
  <style type="text/css">

  border: 0pt solid black;
  width: 100px;
  border: 1px solid black;
  border: 0px solid black;
  <table class="main" >
        <td class="gutter"> </td>
        <td class="card"> </td>
        <td class="gutter"> </td>
        <td class="card"> </td>
        <td class="gutter"> </td>

  $dompdf = new DOMPDF();

dompdf memory issues

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.

Large amount of PDF generation in PHP

We are generating pdf based report cards for our clients on a php based ERP platform. They want to be able to generate around 2000 report cards one pdf file as seperate pages.

We have done this successfully using an HTML to PDF converter called DomPDF. However the script is too heavy and takes about an hour to complete and sometimes breaks, which is unacceptable. They currently used a desktop based software which delivers the report cards instantly via Crystal Reports.

In PHP we were wondering how we could generate such a large number of PDF pages (2000) with a much a higher speed.(hopefully less than 10 seconds).

Any suggestions for this would be welcome.

The server is running on Linux Ubuntu, we dont mind using a solution that involves use of exec.

Git: How to add a remote, merged in a sub folder of a master repository?

I've cloned the codeigniter repository, which in particular creates the application and system folders.

The application folder has sub-folders, libraries and third-party, which are of interest right now.

I'd like to clone this repository : which has in its own root the libraries and third-party folders.

Is there a way to add a new remote to Codeigniter-DOMPDF in my codeigniter repository, which would copy the files and folders in the correct places?

Thanks in advance

Error converting HTML/CSS to PDF using PHP

I build bar codes using jquery in a div in my web app. The black bars are contructed as a set of div tags with their background as black or white as follows,

<div style='padding: 0px; overflow: auto; width: 194px;' id='bar1'>
  <div style='float: left; font-size: 0px; background-color: #FFFFFF; height: 40px; width: 60px'>
  <div style='float: left; font-size: 0px; width:0; border-left: 2px solid #000000; height: 40px;'>

I have tried multiple PHP packages (htmp2pdf, dompdf, tcpdf) to convert this to PDF but come up with either a blank PDF or an error as it sees nested div in the content. Can anyone tell me how can I convert these generated barcodes to PDF suing PHP?

htaccess conditional rewrites

Im using an MVC framework for my PHP application which works great. I have the below code in a .htaccess file in the root folder of my application. This redirects everything to the public folder which is causing issues for me. I want to apply the below to everyfolder apart from one. How would I go about doing this? ie. need to access the /dompdf/ directory and all subdirectories normally wihtout the below rule which redirects.

#<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    public/    [L]
    RewriteRule    (.*) public/$1    [L]
# </IfModule>

Are there any services out there that will let me convert an URL to PDF and let the user download the result?

I have a lot of different sites written in PHP (Drupal) and more and more often clients ask me to create PDFs of various lists, product descriptions and so on.. I've been using dompdf and other pdf libraries but they are a pain to use and have a very limited functionality.

Are there any services out there that'll let me generate a PDF file from a URL and let the user download the result? That would definitely save my day :)

Best regards, Thomas