Or

echo passthru('/usr/bin/wkhtmltopdf http://google.com/ -');

On Oct 26, 9:26 pm, Florian <[email protected]> wrote:
> In order to get the html result of the action execution, yoi can use
> another solution(, which is a way better than the file_get_contents
> solution mentionned here:http://www.symfonyexperts.com/question/show/id/141
> )
>
> in your action:
>
> $html = $this->getController()->getPresentattionFor('module',
> 'action');
> file_put_contents('/tmp/html.html', $html);
>
> $snappy = new SnappyPdf;
> $snappy->setExecutable('/usr/bin/wkhtml2pdf'); // or whatever else
> $snappy->save('/tmp/html.html', '/tmp/pdf.pdf');
>
> Hope it works ! ( cause i didn't tested)
>
> On 26 oct, 15:20, Florian <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > you can use local html file too :
>
> > $snappy->save('file:///tmp/file.html', '/tmp/my.pdf');
> > or
> > $snappy->save('./file.html', '/tmp/my.pdf');
>
> > This way, you have no more problems of http/cookie credentials :)
>
> > For the images problem, you have to give either an absolute path or
> > run your script relative to the path to start from.
>
> > ( seehttp://code.google.com/p/wkhtmltopdf/wiki/Usage:"You need to
> > run wkhtmltopdf in the directory above images." )
>
> > On 23 oct, 15:10, ming <[email protected]> wrote:
>
> > > On Oct 22, 9:29 am, Florian <[email protected]> wrote:
>
> > > > Rectification:
>
> > > > $snappy = new SnappyPdf;
> > > > $snappy->setExecutable('/usr/bin/wkhtml2pdf'); // or whatever else
> > > > $snappy->save('http://google.fr', '/tmp/google.pdf');
>
> > > Your code work right, but how I can retrieve a page that required
> > > authentication?
> > > When I call $snappy->save, wkhtmltopdf open a new http connection with
> > > no cookie and credential...

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to