Hi,

Issue is that the location of the generated files for ttfont and tmp data is allways saved in the lib folder.
Even though "Auto-configure the PDF tool settings" (variable "print_pdf_autoconfig") is set to true, the ttfontdata is not saved in public://print_pdf/print_pdf_mpdf/ttfontdata/ and public://print_pdf/print_pdf_mpdf/tmp/

requirements:
7.x-2.x version of module
mpdf library version < 7

steps to reproduce:
enable "mPDF library handler" module
in page admin/config/user-interface/print/pdf_en check "Auto-configure the PDF tool settings" (set to TRUE)
create a basic page
click on the pdf icon (it is at this point that the ttfont data is generated)
you should see the generated files in the lib folder under mpdf/ttfontdata

Thank you.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Andras_Szilagyi created an issue. See original summary.

Andras_Szilagyi’s picture

Found the issue to be that lib gets loaded before usage in print_pdf_mpdf_pdf_tool_version(), so the constants for dirpath get set to early

if (file_exists(DRUPAL_ROOT . '/' . $pdf_tool)) {
  include_once DRUPAL_ROOT . '/' . $pdf_tool;
}
Andras_Szilagyi’s picture

Status: Active » Needs review
Andras_Szilagyi’s picture

and another issue, this

drupal_realpath('public://print_pdf/print_pdf_mpdf/ttfontdata/')
drupal_realpath('public://print_pdf/print_pdf_mpdf/tmp/')

was missing trailing slash..

enriquelacoma’s picture

I tested patch #4 and works as intended. With this patch, once the option "Auto-configure the PDF tool settings" is enabled, data files are saved on the path: public://print_pdf/print_pdf_mpdf/ttfontdata/

Andras_Szilagyi’s picture

Status: Needs review » Reviewed & tested by the community
jcnventura’s picture

Status: Reviewed & tested by the community » Needs work

I'm pretty sure this breaks print_pdf_mpdf_pdf_tool_version().

jcnventura’s picture

  • jcnventura committed cbef103 on 7.x-2.x
    Issue #3036143 by jcnventura, Andras_Szilagyi: call of _version() within...
jcnventura’s picture

Status: Needs work » Fixed

This should be a proper fix for it.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.