Copied to clipboard

Flag this post as spam?

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


  • Bjørn Fridal 274 posts 784 karma points
    Aug 03, 2010 @ 17:01
    Bjørn Fridal
    0

    Change the name of the PDF

    Hi,

    Is it possible to change the name of the generated PDF file?

    Currently mine turns out something like "page.aspx.pdf" and I would prefer "some-other-name.pdf".

    Cheers
    Bjørn Fridal

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Aug 03, 2010 @ 20:52
    Darren Ferguson
    0

    Which browser are you using.

    for me it is just page.pdf (no .aspx)

    The simplest way to do this would be to use url rewriting,

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Aug 03, 2010 @ 21:00
    Darren Ferguson
    0

    You could also add a macro that sets a content disposition header to the template however that would force the pdf to load out of browser.

    I'd just set rewrite rules so that /path/to/my/(.*?)\.pdf$ rewrites to /path/to/my/($1).aspx

    Make sense?

  • Bjørn Fridal 274 posts 784 karma points
    Aug 03, 2010 @ 21:20
    Bjørn Fridal
    0

    Hi,

    Thanks, Yes it makes sense. I'll give it a try.

    Oh and I use Firefox 3.6

    Cheers
    Bjørn Fridal

  • Chris Houston 535 posts 980 karma points MVP admin c-trib
    Nov 12, 2010 @ 23:19
    Chris Houston
    0

    Hi, I thought I would add my experience with the filenames, I found that if you use the URL redirect the browser still uses the original URL name and hence in my senario you end uo with a file called PDF.PDF However if you use the alttemplate=pdf method on the end of the url the file will be named using the current page name. I think as Darren mentioned above the real solution is to somehow set one of the HTTP headers, i will look into this next week and post my finding / solution if no one else has beat me too it :) chris

  • Chris Houston 535 posts 980 karma points MVP admin c-trib
    Nov 15, 2010 @ 22:26
    Chris Houston
    1

    Hi All,

    I just blogged about this if anyone else wants to do this with a few code snippets to do what you need to do.

    Creating PDF documents dynamically using Umbraco and XSL-FO part 2

    I hope it's useful to someone :)

    Cheers,

    Chris

     

Please Sign in or register to post replies

Write your reply to:

Draft