Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gavin Bewley-Jones 25 posts 71 karma points
    Feb 20, 2015 @ 13:11
    Gavin Bewley-Jones
    0

    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

     

     

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Feb 21, 2015 @ 11:33
    Darren Ferguson
    0

    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

  • Kevin Jump 2343 posts 14890 karma points MVP 8x c-trib
    Feb 21, 2015 @ 13:29
    Kevin Jump
    0

    Query String ? 

  • Gavin Bewley-Jones 25 posts 71 karma points
    Feb 21, 2015 @ 14:48
    Gavin Bewley-Jones
    0

    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.

    :-)

     

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Feb 21, 2015 @ 15:34
    Darren Ferguson
    0

    You just have two templates one for HTML, one for PDF and use umbraco altTemplate syntax:

    http://www.nibble.be/?p=42

  • Gavin Bewley-Jones 25 posts 71 karma points
    Feb 21, 2015 @ 16:13
    Gavin Bewley-Jones
    0

    Ahhh, of course ... Forgot about Alt Templates.


    Thanks for your help.

  • Gavin Bewley-Jones 25 posts 71 karma points
    Mar 26, 2015 @ 11:12
    Gavin Bewley-Jones
    0

    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 

     

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Mar 28, 2015 @ 10:05
    Darren Ferguson
    0

    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!

Please Sign in or register to post replies

Write your reply to:

Draft