raunakbinani / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

Fatal Error when generating PDF: Call to undefined method Style::merge() #85

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install dompdf
2. Try to generate a pdf

What is the expected output? What do you see instead?
Expect to see a generated PDF, instead, a fatal php error is thrown: Fatal
error: Call to undefined method Style::merge() in
/var/www/vhosts/playmakerprocrm.com/subdomains/sm/httpdocs/lib/dompdf/include/st
ylesheet.cls.php
on line 196

What version of the product are you using? On what operating system?
0.5.1 on Apache/Linux/RedHat

Please provide any additional information below.

Original issue reported on code.google.com by sethcrie...@gmail.com on 4 Nov 2009 at 11:40

GoogleCodeExporter commented 9 years ago
Can you try DOMPDF 0.6.0 alpha2 to see if it is still a problem? We don't plan 
on releasing any patches for the 
0.5.1 code, but if this is still an issue we will address it.

Also, if you are able can you provide a sample document that causes the error? 

Original comment by eclecticgeek on 6 Nov 2009 at 3:16

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I am still getting the same error with 0.6.0 alpha2...Here is the actual script 
i am
using to try and generate a pdf:

<?php
require 'lib/dompdf2/dompdf_config.inc.php';
$dompdf = new DOMPDF();
$dompdf->load_html('hello world');
$dompdf->render();
$dompdf->stream("sample.pdf");die();
?>

Fatal error: Call to undefined method Style::merge() in
[...]lib/dompdf2/include/stylesheet.cls.php on line 218

Thank you!

Original comment by sethcrie...@gmail.com on 6 Nov 2009 at 7:45

GoogleCodeExporter commented 9 years ago
The problem is maybe that what you load with load_html is not HTML ? ;)

Original comment by phenxdesign on 6 Nov 2009 at 7:59

GoogleCodeExporter commented 9 years ago
I would expect it to render the document even with a simple "hello world" test. 
I have confirmed that on my 
own system. Despite the strictness of DOMDocument it will attempt to create a 
valid document. You can 
confirm this in 0.6.0 alpha 2 using the following code:

<?php
require 'lib/dompdf2/dompdf_config.inc.php';
$dompdf = new DOMPDF();
$dompdf->load_html('hello world');
$dompdf->output_html();
?>

What version of PHP are you running?

Original comment by eclecticgeek on 7 Nov 2009 at 1:14

GoogleCodeExporter commented 9 years ago
Hello,

I have the same problem and no way to resolve it. I search on the web, on the 
forum, 
into the groupe google and nobody have the same problem.

Can you help me ? I am sure that that the error come from the render() function 
when it 
call add_style()... I don't understand the link between the two classes Style 
and 
Stylesheet. This last called on line 217 a $this->_styles[$key]->merge and it's 
the 
cause of the error.

Thanks for your help.

Original comment by quentin....@gmail.com on 15 Mar 2010 at 2:12

GoogleCodeExporter commented 9 years ago
@quentin.janon: The Stylesheet class deals with loading a document stylesheet 
while
the Style class deals with the specific entries in the stylesheet.

What version of PHP are you using? Can you provide a sample document that 
exhibits
the error?

Original comment by eclecticgeek on 24 Mar 2010 at 4:39

GoogleCodeExporter commented 9 years ago
I suspect a class "Style" which is already defined in the system in which you 
want to integrate dompdf.

Original comment by fabien.menager on 1 Feb 2011 at 9:05

GoogleCodeExporter commented 9 years ago
That was that fabien menager ! 

Thanks for the help !

Original comment by quentin....@gmail.com on 6 Feb 2011 at 10:15

GoogleCodeExporter commented 9 years ago
Great! How did you fix it?

Original comment by fabien.menager on 6 Feb 2011 at 10:42

GoogleCodeExporter commented 9 years ago
Hello guys? Can you please share, how did you fix it?

Original comment by hitesh.w...@gmail.com on 29 May 2011 at 12:09

GoogleCodeExporter commented 9 years ago
I find Style definition on my project and see that I have 2 definitions call 
Style so, try replace class Style with other name, I replace Style class name 
with Stylepdf and Fix!!!

Original comment by joluissc...@gmail.com on 28 Sep 2011 at 3:00

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 30 May 2013 at 5:15