Save Current Page to PDF and Save to Google Drive / Drop Box
Hi Darren,
Looking at the PDF Creator and it looks great but just got a couple of questions on the best way to do something.
My client site has a lot of pages and they want buttons for saving to PDF, save to google drive and save to drop box.
For the first, save to PDF, what would you say the best way for handling this, would you use a QS and then simply load page again with QS and then either use the Razor for the HTML output or the PDF output?
The CMS editor doesnt really want to have to worry about selecting new templates or creating child pages for the PDF version etc they just want to create one page of content and it handle it all.
For Google Drive and Save to Dropbox have you had to handle this with the PDF creator yet, if so, any tips you can give?
Saving to disc - there is a disposition header you can set in the example template that makes the browser initiate a download.
For drive and dropbox I'd write a controller that reads the URL of the PDF, temporarily saves it to a temp folder on the web server, but the plumbing to upload it to google drive or dropbox via their APIs isn't something that I've done.
Sorry, yes, query string .. Should have just said that hahaha
>>Saving to disc - there is a disposition header you can set in the example template that makes the browser initiate a download.
OK ... But, does that still need the PDF template to be set seperately from the razor template / view as I think they will struggle if they need to set up multiple pages etc, they can just about cope with setting up one pages worth of content.
Finally at a stage in this project to look at this in more detail.
We have it hooked up so that every page that needs PDF rendering is using an alertnative URL, i.e. /pdf at the end of it, and this renders fine.
Google Drive works fine and users can save the PDF to it and then open and read it but drop box seems to have issues and the user received the attached message when trying to open the saved PDF:
So it looks like it isn't saving it properly at that point.
If I save run the /pdf URL in the browser and then save as locally, upload through CMS and then link to this generated PDF and save to dropbox it works, it's just from the /pdf URL itself.
Have you come across similar before?
I looked into your suggestion of a controller loadidng the URL in but all the content pages are behind a login and not publicly accessable so I would assume this wouldnt be feasible in that instance?
I can only imagine that this would be do to with any custom code that you have that places the file into dropbox.
If you can share that I'll be happy to take a look... I don't really understand how the PDF is syndicated to users via dropbox, so can't help too much without a little more detail.
Save Current Page to PDF and Save to Google Drive / Drop Box
Hi Darren,
Looking at the PDF Creator and it looks great but just got a couple of questions on the best way to do something.
My client site has a lot of pages and they want buttons for saving to PDF, save to google drive and save to drop box.
For the first, save to PDF, what would you say the best way for handling this, would you use a QS and then simply load page again with QS and then either use the Razor for the HTML output or the PDF output?
The CMS editor doesnt really want to have to worry about selecting new templates or creating child pages for the PDF version etc they just want to create one page of content and it handle it all.
For Google Drive and Save to Dropbox have you had to handle this with the PDF creator yet, if so, any tips you can give?
Thanks
Gavin
Hi Gavin,
I'm not sure what you mean by a QS.
Saving to disc - there is a disposition header you can set in the example template that makes the browser initiate a download.
For drive and dropbox I'd write a controller that reads the URL of the PDF, temporarily saves it to a temp folder on the web server, but the plumbing to upload it to google drive or dropbox via their APIs isn't something that I've done.
I hope that helps?
Best
Query String ?
Sorry, yes, query string .. Should have just said that hahaha
>>Saving to disc - there is a disposition header you can set in the example template that makes the browser initiate a download.
OK ... But, does that still need the PDF template to be set seperately from the razor template / view as I think they will struggle if they need to set up multiple pages etc, they can just about cope with setting up one pages worth of content.
:-)
You just have two templates one for HTML, one for PDF and use umbraco altTemplate syntax:
http://www.nibble.be/?p=42
Ahhh, of course ... Forgot about Alt Templates.
Thanks for your help.
Hi Darren,
Finally at a stage in this project to look at this in more detail.
We have it hooked up so that every page that needs PDF rendering is using an alertnative URL, i.e. /pdf at the end of it, and this renders fine.
Google Drive works fine and users can save the PDF to it and then open and read it but drop box seems to have issues and the user received the attached message when trying to open the saved PDF:
So it looks like it isn't saving it properly at that point.
If I save run the /pdf URL in the browser and then save as locally, upload through CMS and then link to this generated PDF and save to dropbox it works, it's just from the /pdf URL itself.
Have you come across similar before?
I looked into your suggestion of a controller loadidng the URL in but all the content pages are behind a login and not publicly accessable so I would assume this wouldnt be feasible in that instance?
Regards
Gavin
Hi Gavin,
I can only imagine that this would be do to with any custom code that you have that places the file into dropbox.
If you can share that I'll be happy to take a look... I don't really understand how the PDF is syndicated to users via dropbox, so can't help too much without a little more detail.
Thanks!
is working on a reply...