DOMpdf problems

815 views
Skip to first unread message

febie

unread,
Jul 7, 2009, 8:53:35 AM7/7/09
to dompdf
hi,

anyone can help me about the installation of dompdf.. i download the
files of dompdf and i try testing the sample on my localhost but when
i click the submit button it will say "Internet Explorer cannot
display the webpage".. i dont know whats going on because its my first
time to use the DOMpdf.. should i modify the dompdf_config.inc.php ??
what are the things to be edited ?? can anyone help me guide me on
what i will do.... any help will appreciated.. tnx :-)

Jacob

unread,
Jul 8, 2009, 2:15:00 PM7/8/09
to dompdf
Admittidly, I've never tried the sample scripts that ship with
dompdf. When I was getting started, I did run the hello world script
from the website.

Try the following modified hello world script:

<?php
require_once("dompdf_config.inc.php");
$html = "<html><body><p>Hello World!</p></body></html>";

$dompdf = new DOMPDF();
$dompdf->load_html($html);

$dompdf->render();

file_put_contents("sample.pdf", $dompdf->output());
?>

Save it into the same directory as dompdf_config.inc.php. Run it, and
hopefully, it should produce sample.pdf containing a Hello World
paragraph. If this works, you know that everything is setup
correctly.

febie

unread,
Jul 9, 2009, 9:35:51 AM7/9/09
to dompdf
helo jacob,

tnx for your reply :-)

i did try your script but it didn't work,.it will only loading
longer..the browser display
" Connection Interrupted
The connection to the server was reset while the page was loading.
The network link was interrupted while negotiating a connection.
Please try again." I did save it into the same directory as
dompdf_config.inc.php.
do u have an idea what is the problem??

Carlos

unread,
Jul 9, 2009, 11:28:13 AM7/9/09
to dompdf
I am having the same problem as Febie.

On google code someone managed to install it on windows (http://
code.google.com/p/dompdf/wiki/Installation), I followed their steps
but couldn't reproduce their results.

Also, is PDFLib installation necessary? I am on apache xampp 1.7.1.
Would it already have it installed?

Carlos

BrianS

unread,
Jul 9, 2009, 2:19:59 PM7/9/09
to dompdf
You may or may not not need to modify dompdf_config.inc.php ... it
really depends on what you're trying to do. That being said, there's
nothing you need to modify in this file to run the samples.

However, there is one file that you *must* deal with prior to using
DOMPDF. In dompdf/lib/fonts you need to ensure that
dompdf_font_family_cache exists. If it does not you can try using the
version that accompanies the distribution
(dompdf_font_family_cache.dist). Just remove the ".dist" from the end
of the file.

If this doesn't work, any errors you can provide would be helpful.
Since you're not seeing anything on screen check your Apache and PHP
error.log files.

-b

BrianS

unread,
Jul 9, 2009, 2:33:08 PM7/9/09
to dompdf
On Jul 9, 11:28 am, Carlos <carl...@hkusua.hku.hk> wrote:
> I am having the same problem as Febie.
>
> On google code someone managed to install it on windows (http://
> code.google.com/p/dompdf/wiki/Installation), I followed their steps
> but couldn't reproduce their results.

Are you have problems with DOMPDF in general or with load_font.php?
You do not need to follow the special notes regarding Windows if all
you want is regular PDF creation. load_font.php is necessary only if
you intend to use fonts not available by default (namely arial,
courier, and times).

> Also, is PDFLib installation necessary? I am on apache xampp 1.7.1.
> Would it already have it installed?

There's no need to have PDFLib installed and I do not believe PDFLib
is included with XAMPP. DOMPDF includes a PDF rendering engine called
CPDF which is written entirely in PHP.

-b

febie

unread,
Jul 9, 2009, 3:15:28 PM7/9/09
to dompdf
hi,

i follow what you say and i check the dompdf_font_family_cache, IT
exist and it doesn't work So i check the error.log files

this is the ERROR i got:

PDFlib exception (fatal): [1202] PDF_set_parameter: Unknown key
'objorient'
[Thu Jul 09 15:05:59 2009] [notice] Parent: child process exited with
status 99 -- Restarting.
[Thu Jul 09 15:06:02 2009] [notice] Apache/2.2.9 (Win32) DAV/2 mod_ssl/
2.2.9 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.6 configured --
resuming normal operations
[Thu Jul 09 15:06:02 2009] [notice] Server built: Jun 14 2008 19:02:12
[Thu Jul 09 15:06:02 2009] [notice] Parent: Created child process 2336
[Thu Jul 09 15:06:03 2009] [notice] Child 2336: Child process is
running
[Thu Jul 09 15:06:03 2009] [notice] Child 2336: Acquired the start
mutex.
[Thu Jul 09 15:06:03 2009] [notice] Child 2336: Starting 250 worker
threads.
[Thu Jul 09 15:06:03 2009] [notice] Child 2336: Starting thread to
listen on port 443.
[Thu Jul 09 15:06:03 2009] [notice] Child 2336: Starting thread to
listen on port 80.

where i can find the 'objorient' ? ANY HELP for this??

tnx a lot for your quick reply :-)

- febie (^ - ^)

psychoactive

unread,
Jul 9, 2009, 4:59:10 PM7/9/09
to dompdf
hey, in your configuration for dompdf change the rendering engine to
CPDF not pdflib.

the rest of that stuff is from your apache log

Carlos

unread,
Jul 9, 2009, 3:15:15 PM7/9/09
to dompdf
I did check the error log, it reports
----------------
PDFlib exception (fatal): [1202] PDF_set_parameter: Unknown key
'objorient'
[Fri Jul 10 02:17:37 2009] [notice] Parent: child process exited with
status 99 -- Restarting.
:
:
PHP Warning: Module 'pdf' already loaded in Unknown on line 0
:
:
----------------

So the problem lies at the installation of PDFLib I am guessing.

I am on apache xampp 1.7.1. The phpinfo() shows
-----------
PDF Support enabled
PDFlib GmbH Version 5.0.3
-----------

And I also had PDFLib Lite installed. Still no sign that it is
working.............


I notice in the installation guide that "domxml PECL extenstion
conflicts must be disabled".
Could this be the problem?
How do I disable it?


Carlos


Additional info
===========
I had PDFlib lite installed and made the following change in
dompdf_config.inc
1. define("TTF2AFM", "C:/Progra~1/GnuWin32/bin/ttf2pt1.exe");
2. define("DOMPDF_PDF_BACKEND", "PDFLib");

BrianS

unread,
Jul 9, 2009, 10:26:06 PM7/9/09
to dompdf
On Jul 9, 3:15 pm, Carlos <carl...@hkusua.hku.hk> wrote:
> I did check the error log, it reports
> ----------------
> PDFlib exception (fatal): [1202] PDF_set_parameter: Unknown key
> 'objorient'
> :
> :
> PHP Warning:  Module 'pdf' already loaded in Unknown on line 0

This could be PHP loading PDFLib then attempting to load PDFLib lite
later on, but I'm not positive about that.

> So the problem lies at the installation of PDFLib I am guessing.
>
> I am on apache xampp 1.7.1. The phpinfo() shows
> -----------
> PDF Support     enabled
> PDFlib GmbH Version     5.0.3
> -----------
>
> And I also had PDFLib Lite installed. Still no sign that it is
> working.............
>
> Additional info
> ===========
> I had PDFlib lite installed and made the following change in
> dompdf_config.inc
> 1. define("TTF2AFM", "C:/Progra~1/GnuWin32/bin/ttf2pt1.exe");
> 2. define("DOMPDF_PDF_BACKEND", "PDFLib");

So it does look like DOMPDF is trying to use PDFLib, but not the lite
version since you're getting a licensing error. I would try define
("DOMPDF_PDF_BACKEND","CPDF") to tell DOMPDF to use the built-in back-
end. This should avoid the licensing errors with PDFLib.

> I notice in the installation guide that "domxml PECL extenstion
> conflicts must be disabled".
> Could this be the problem?
> How do I disable it?

I doubt this is installed, but if it is I would think you would see it
in the output from phpinfo(). The most recent version of PHP has DOM
and XML support built in, so don't confuse the built-in support with
the PECL extension. PECL is a command-line tool to install extensions
to PHP.

> [Fri Jul 10 02:17:37 2009] [notice] Parent: child process exited with
> status 99 -- Restarting.

This could be related to the PDFLib issues or it could be something
more serious. If you're still having problems after you change the
back end see if this message is still showing up.

Carlos

unread,
Jul 10, 2009, 2:49:18 AM7/10/09
to dompdf
Thank you for you help Brian,

I did the '("DOMPDF_PDF_BACKEND","CPDF")' change, but the error log
still reports :

PDFlib exception (fatal): [1202] PDF_set_parameter: Unknown key
'objorient'
[Fri Jul 10 14:45:59 2009] [notice] Parent: child process exited with
status 99 -- Restarting.
:
:

identical to the result without the change........

Thanks a million for your generous help!


Carlos

febie

unread,
Jul 13, 2009, 9:33:04 AM7/13/09
to dompdf
hello calos,

i did find solutions on the problems we encountered..

open your httpd.conf located in apache/conf/httpd.conf then i search
the mod_rewrite.so
you will find the #LoadModule rewrite_module modules/mod_rewrite.so
what i do is remove the # on this " #LoadModule rewrite_module modules/
mod_rewrite.so" and save it..
then after that i modify the dompdf config this line
("DOMPDF_PDF_BACKEND","auto") into ("DOMPDF_PDF_BACKEND","CPDF")

then i try to run again the sample then it did run.. i hope it will
help you :-)

--febie ( ^ - ^ )

BrianS

unread,
Jul 21, 2009, 1:24:17 PM7/21/09
to dompdf
On Jul 10, 2:49 am, Carlos <carl...@hkusua.hku.hk> wrote:
> I did the '("DOMPDF_PDF_BACKEND","CPDF")' change,  but the error log
> still reports :
>
> PDFlib exception (fatal): [1202] PDF_set_parameter: Unknown key
> 'objorient'
> [Fri Jul 10 14:45:59 2009] [notice] Parent: child process exited with
> status 99 -- Restarting.
> :
> :
>
> identical to the result without the change........

This appears to be some kind of PDFLib error. I don't believe it
should still be showing if you've successfully made the change to
DOMPDF_PDF_BACKEND. To ensure that you're not using PDFLib you can try
disabling the PDFLib extension. I'm not familiar with XAMPP so I don't
know if there's a configuration interface that will allow you to turn
off PDFLib support or if you have to do it in your php.ini.
Reply all
Reply to author
Forward
0 new messages