Hi,
I’ve started working on a snippet which will handle on the fly PDF conversion of page content, through a PDF link.
But I’ve stumbled upon a big problem : I want the user to remain on the current page and have a "save as" window pop-up. I have set up a link which points to the current page, and pass a ’pdf’ variable to the url : the snippet start generating the PDF when it detect the parameter.
Right now, I do have the "save as" window, but the file field is empty (instead of having whatever.pdf in it, it’s blank).
I have configured the snippet to write the PDF to the server instead of sending it to the browser and when I do this, it works the pdf is created and saved on the server.
That’s why I think there is a problem with http headers.
If I were not developping for MODx, I would just set a link to the php file generating the PDF and it would simply work.
But in the case of this snippet, I am stuck !
I had considered using a plugin but I don’t see what’s the logic behind it (is it possible to test a POST or GET variable with it ??)
I have a lot to learn before mastering MODx !
If someone can help, I am all ears
Thank’s to davidm for the translation of my original message posted in the french forum
http://modxcms.com/forums/index.php/topic,5502.0.html