This is what happens with dompdf-0.5.1 library that can be downloaded from provided link. Maybe it works for D6 version but for D7 it is not working.

For anyone in non-english speaking world it is important to have full UNICODE support and I didn't figure out how can I manage that. I tried adding Arial by generating fonts metrics and adding to dompdf-0.6.beta2 but it didn't work.

Can you make similar dompdf package for D7 and include Arial at least? Or just let us use 0.5.1 version (0.5.2 is actuell now) or provide enough information on how to include any ttf font (dompdf site have no instructions and in README.txt file information is not complete or there are changes from 0.5 to 0.6 and it doesn't work).

Have you considered other PHP libraries as tcpdf or fpdf http://www.fpdf.org/?

Print module also uses */libraries/ but enables user to choose library

CommentFileSizeAuthor
#5 update_dompdf_library-1111880-5.patch565 bytesBenR
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Same problem for me. I upgraded to dompdf version 0.6, no error about upgrading now, but if I click the pdf icon, empty page appears.

pietervogelaar’s picture

Assigned: Unassigned » pietervogelaar
Status: Active » Fixed

Added a link for Drupal 7 to the dompdf 0.6-beta2 version at http://drupal.org/project/invoice.

Direct link: http://www.platinadesigns.nl/downloads/dompdf_0.6-beta2.tar.gz.
I added the Arial font to this one, just like the 0.5.1 version.

Pieter

pietervogelaar’s picture

Status: Fixed » Closed (fixed)
DrCord’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Issue summary: View changes
Status: Closed (fixed) » Active

This issue still exists. Due to the fact that you are checking for a string in the DOMPDF file and versions after 6.2(ish, some 6.2 betas seem to not work either) do not have that string, what you are actually checking is whether DOMPDF is after 6.0 but before 6.3, which makes your module hard to use, as 6.3 is readily available and is what other modules will expect.

To fix the problem, at least temporarily, I changed the file invoice_helpers.inc, function _invoice_dompdf_include_lib starting at line 727 (if ($file !== NULL) { ) :

original:

  if ($file !== NULL) {
    $content = file_get_contents($file);
    if (strpos($content, 'spl_autoload_register') !== false) {
     require_once $file;
    }
    else {
      drupal_set_message(t('Update your DOMPDF library, version 6 or higher is required!'), 'error');
      $error = TRUE;
    }
  }

Changed:

  if ($file !== NULL) {
      require_once $file;
  }
BenR’s picture

Status: Active » Needs review
FileSize
565 bytes

Here is the patch.