KnpLabs / snappy

PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage

Home Page:https://knplabs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Encoding filename

TristanPouliquen opened this issue · comments

Hello,

I am facing a small problem :

I am trying to generate a file with a title that can contain characters such as ï and other strange looking accents (French ones mostly).

For now, there is a problem with the generation because the name passed to wkhtmltopdf by your wrapper takes away these letters and this causes the generation to fail.

Does anyone have already encountered the issue ? Does anyone have an idea of solution ?

Thanks

@TristanPouliquen This reminds me old bugs relating to shell/php charset. But could you provide me a simple bug reproducer so I could investigate this issue more?

@NiR- thanks for your answer. I'll try and setup a bug reproducer. I've faced it on AWS Elastic Beanstalk instances, but not on my local Ubuntu install.

Closing this issue for inactivity.
If it's still relevant, please answer this comment with the required details.

Hello. I got the same problem, but i'm not sure what information you need.
On my local machine it works perfect, but on the webserver, linux, hosted so I don't have full access, it is not working for the file names, also have an error when having french or german special characters, and in the footer where i print text too, there no error but specials chars are simply not there. So the word "Démo" appears like "Dmo".
I generate footer with pdf options lije this
[ 'footer-center' => 'My text in the footer...' ]

The content of the PDF (generated from html) are fine except footer.
Does anyone have a clue?

I found a workaround for the footer. I generat a full html page and serve it to the footer.
$footer = $this->renderView('report/reports/_report_footer.html.twig', [...]); ... 'footer-html' =>$footer,
And it works.

Still have to problem with file names, no special character possible.