putolaruan
putolaruan

Reputation: 2054

dompdf with codeigniter

I followed this tutorial:

https://github.com/EllisLab/CodeIgniter/wiki/PDF-generation-using-dompdf

However, I can't seem to set the path right. On the config file of dompdf (config_dompdf.inc.php) I did the following:

define("DOMPDF_DIR", realpath(dirname('./system/plugins/dompdf/')));

I get this error:

Message: require_once(/var/www/myApp/system/plugins/include/functions.inc.php) [function.require-once]: failed to open stream: No such file or directory

Filename: dompdf/dompdf_config.inc.php

Line Number: 233

As per the tutorial, I placed the dompdf directory under system/plugins. But you can see above that on line 233, there is an error because of an incorrect path. How do I fix the path?

(define("DOMPDF_DIR", realpath(dirname('./system/plugins/dompdf/')));)

Thanks!

Upvotes: 0

Views: 5964

Answers (3)

BrianS
BrianS

Reputation: 13914

You only need to change the value of DOMPDF_DIR if you have moved dompdf_config.inc.php from its usual location in the dompdf directory. Otherwise, dompdf is already set up to populate that constant with the correct path. Based on the information you have provided I do not believe you should have modified the default value.

Upvotes: 0

A Karim
A Karim

Reputation: 11

this file take $_GET['input_file'] as the name of the file that should be converted to pdf

http://localhost/dompdf/dompdf.php?input_file=[nameofyourfile]

Upvotes: 1

putolaruan
putolaruan

Reputation: 2054

A custom loader that is on autoload is conflicting with DOMPDF, that's the reason it doesn't work. Switched to TCPDF since the custom loader is used by all controllers of the app.

Upvotes: 1

Related Questions