Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash with TOC header in html #219

Closed
fighter777 opened this issue Mar 15, 2017 · 6 comments
Closed

crash with TOC header in html #219

fighter777 opened this issue Mar 15, 2017 · 6 comments

Comments

@fighter777
Copy link

fighter777 commented Mar 15, 2017

hello, phpwkhtmltopdf don't convert my html header TOC in temporaly file html and send the html escaped to wkhtmltopdf

Failed without error message: C: && cd "C:\inetpub\src\Controllers\..\..\..\resources\bin\32" && wkhtmltopdf_12.4_MSVC.exe --orientation "landscape" --page-size "A5" --disable-smart-shrinking --margin-bottom "10" --margin-top "20" --margin-left "5" --margin-right "5" "C:\inetpub\temp\tmpAFC.tmp.html" --header-html "C:\inetpub\temp\tmpAEC.tmp.html" --header-line --footer-center "CONFIDENTIEL" --footer-left "[date] [time]" --footer-line --header-spacing "0.2" toc --header-html "< DOCTYPE html> <html> <head> <meta http-equiv= Content-Type content= text/html; charset=UTF-8 /> <link href= ../public/static/css/pdf/editeur.css?ref rel= stylesheet > <link href= ../public/static/css/generation_livret/model_livret.css?ref rel= stylesheet > </head> <body> <section> <div class= header > </div> </section> </body> </html>" --header-line --toc-header-text "sommaire" --footer-center "CONFIDENTIEL" --footer-right "[page]/[toPage]" --footer-left "[date] [time]" --footer-line --header-spacing "0.2" "C:\inetpub\temp\tmpAFE.tmp.html" --header-line --header-html "C:\inetpub\temp\tmpAFD.tmp.html" --footer-right "[page]/[toPage]" --footer-center "CONFIDENTIEL" --footer-left "[date] [time]" --footer-line --header-spacing "0.2" "C:\inetpub\temp\tmpB0F.tmp.pdf

that work with a url

@mikehaertl
Copy link
Owner

Hmm, can you do some debugging? I would focus on the block here:

https://github.com/mikehaertl/phpwkhtmltopdf/blob/master/src/Pdf.php#L305

Find out, why no new File is created in line 309.

@mikehaertl
Copy link
Owner

mikehaertl commented Mar 15, 2017

I think I found it. Can you try to add this line to Pdf.php before line 146:

public function addToc($options=array())
{
    // Add this:
    $options = $this->processOptions($options);

@mikehaertl
Copy link
Owner

@fighter777 The above fix is available on master. Could you help testing please?

@fighter777
Copy link
Author

hello, i test that tomorrow ;)

@fighter777
Copy link
Author

its good for me, thx you 👍

@mikehaertl
Copy link
Owner

Thanks. The fix is included in the new 2.2.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants