Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    open a file created in JS

    I've been watching an application called JSPDF http://code.google.com/p/jspdf/ that creates a PDF file solely in client side javascript.
    In a nutshell, it generates pdf bytes (called buffer), encodes the bytes into base64, and opens it in the browser:
    Code:
    document.location.href = 'data:application/pdf;base64,' + Base64.encode(buffer);
    This works for me in firefox and chrome, but not IE. My question: is there a better way to reform the file download/opening in javascript? They provide an example with downloadify and that may be acceptable unless you are trying to eliminate flash from the equation.

    Thanks
    Last edited by concealed; 01-05-2011 at 07:26 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •