mittwald / typo3-web2pdf

A TYPO3 extension for rendering content as PDF
GNU General Public License v2.0
18 stars 20 forks source link

mpdf error #71

Closed webdev2027 closed 6 years ago

webdev2027 commented 7 years ago

Hello.

I'm using TYPO3 7.6. with PHP 5.6.30, GraphicsMagick, Ghostscript (8.70).

After install the ext. and try to click the test link, I've created with page.100 < lib.web2pdfor I use the Frontend-Plugin as a content module. In both ways, I've got an error:

WriteHTML() requires $html be an integer, float, string, boolean or an object with the __toString() magic method.at line ext/web2pdf/Vendor/mpdf/mpdf/mpdf.php in line 15884.

I don't use concatenateCss/Js , compressJs/Css, FE compression or realURL for testing. My URL: http://dev.domain.com/index.php?id=210&L=0&id=210&tx_web2pdf_pi1%5Bargument%5D=printPage&tx_web2pdf_pi1%5Baction%5D=&tx_web2pdf_pi1%5Bcontroller%5D=Pdf&cHash=xxx

I don't see any other settings. All constants (TS) are untouched.

pstranghoener commented 7 years ago

Hello,

we upadated mPDF in the last version could you change your PHP Version to 7.x. And look if it works...

Best Regards Philipp

Mordef commented 7 years ago

We have the same Problem and we use: Typo3 8.7.3 PHP 7.0.22 web2pdf 1.1.6

Error-Message:

Oops, an error occurred!
WriteHTML() requires $html be an integer, float, string, boolean or an object with 
the __toString() magic method.

We try to debug it. In the function WriteHTML (mpdf.php row 15874) $html is "NULL"

andwee commented 7 years ago

Same problem here:

TYPO3 7.6.22 web2pdf 1.1.6 PHP 7.1.6 FPM (P+) (Mittwald) realurl 2.3.0

BUT: Works when realurl is disabled

mgante commented 7 years ago

We get the same error here, too:

TYPO3 7.6.20 PHP 7.0.9-pl0 web2pdf 1.1.6

Unfortunately, disabling realurl (2.2.0), doesn't make a difference.

Here, $html, outputed in the WriteHTML-function, also is NULL.

andwee commented 7 years ago

In our case, the $content for the PDF is available until the call of the method:

Mittwald\Web2pdf\Utility\PdfLinkUtility::replace

The returned content is empty and so the required $html of mpdfs WriteHTML() is also empty. So, I don't think the problem is mpdf itself.

mgante commented 7 years ago

We commented out line 90 in \Mittwald\Web2pdf\View\PdfView::renderHtmlOutput($content, $pageTitle) and now the PDF could be generated (without styles, but this should be another issue).

So it could be possible that the replace-method seems to empty the HTML-content.

kpurrmann commented 6 years ago

Should be fixed with #66. We will release a new version soon.