Hey Florian thanks for the help.

I have Snappy up and running in Symfony 1.4 following the steps you
described. The only difference is that I save the temp html files in
the web folder so that they can access the images and css (I'm
planning on having them erased with a script afterwards).

It works with a secure page, but I'm running into another problem now,
the page I'm generating the pdf from has charts loaded from secure
JSON actions (using JQPlot) and those charts are not shown on the PDF.
Just to clarify they are shown perfectly when I make the JSON actions
"unsecure".

I was thinking that somehow I could also generate temp files for this
JSON actions and change the temp html file to point to a different
javascript file that pointed towards them, seems complicated thou.
Another option would be to make them unsecure for a few seconds every
time a PDF is generated, but this sounds a bit dirty.

Any suggestions??


On Oct 27, 5:34 pm, Florian <[email protected]> wrote:
> you can pass extra parameters like this:
>
> $request->setParameter('id', 1);
>
> On 26 oct, 21:48, ming <[email protected]> wrote:
>
> > On 26 Ott, 15:26, 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)
>
> > I have already tried this solution, but unfortunately
> > getPresentationFor() doesn't permit to pass in some parameters...
> > :(
> > It only works for module/action without parameters so is unusable in
> > my case, because the view that I need to convert to pdf is generated
> > by an action that receive an Id of the object to generate.
>
> > Anyway, many thanks. :)

-- 
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