MouseBits
May 23, 2013, 10:36:07 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Tech Help!  (Read 543 times)
JPWDW
Member

Posts: 303



WWW
« on: December 24, 2011, 01:11:36 pm »

Happy holidays to everyone and merry Christmas. I have a question I need to solve ... NVM sorry. I don't know how to delete post. I solved the issue myself.
-----------
Alright guys, very funny! Here's a question I need to solve:

I need to generate a printable .pdf document using only javacript. I have a .html webpage that lets users fill in some forms. After filling the forms they should be able to click print webpage button and a pdf (of the forms webpage including images and everything) pops up to download or view. Anyone knows how to do this?
« Last Edit: December 26, 2011, 06:39:47 pm by JPWDW » Logged

eyore
V.I.P.

Posts: 7173



Email
« Reply #1 on: December 24, 2011, 03:21:30 pm »

You can't delete posts, only edit them.
I usually just add an Edit: at the bottom and leave them as they are so we know what they were about (being such a nosey lot)  Grin
Logged

"The way to get started is to quit talking and begin doing."
Wizzard419
Member

Posts: 1399


Email
« Reply #2 on: December 24, 2011, 04:56:33 pm »

There is one way to delete posts, or at least remove them from view, drop lots of F-bombs and so forth. Grin
Logged
eyore
V.I.P.

Posts: 7173



Email
« Reply #3 on: December 24, 2011, 04:59:55 pm »

 Tongue
Logged

"The way to get started is to quit talking and begin doing."
JPWDW
Member

Posts: 303



WWW
« Reply #4 on: December 26, 2011, 06:39:24 pm »

Alright guys, very funny! Here's a question I need to solve:

I need to generate a printable .pdf document using only javacript. I have a .html webpage that lets users fill in some forms. After filling the forms they should be able to click print webpage button and a pdf (of the forms webpage including images and everything) pops up to download or view. Anyone knows how to do this?

Thanks!
Logged

kirky
Uploader

Posts: 1341



Email
« Reply #5 on: December 26, 2011, 09:01:33 pm »

I don't know of any JavaScript libraries that would do this.  You're looking to do client side scripting to generate a PDF.  Not the best way to accomplish this if possible.

I've used a few server side packages to do this, none are intuitive.  Working with postscript is a PITA...
Logged
JPWDW
Member

Posts: 303



WWW
« Reply #6 on: December 26, 2011, 09:41:58 pm »

Thanks. And is there a way to get a print button form HTML that can print me a webpage?
Logged

kirky
Uploader

Posts: 1341



Email
« Reply #7 on: December 26, 2011, 10:34:03 pm »

You might have one luck with a separate style sheet for the print media type.  You can style all the form fields and position them as necessary.  Most important browsers support this these days.
Logged
JPWDW
Member

Posts: 303



WWW
« Reply #8 on: December 27, 2011, 12:23:47 am »

Thanks kirky! I did what you mentioned. It worked! Turns out there is a javascript for prining using a Html form. Worked perfectly!
Logged

pixelated
Member

Posts: 3368


« Reply #9 on: December 27, 2011, 02:03:46 am »

It looks like you've found a solution already but if you're still curious about PDF:
jsPDF generates PDF documents using pure JavaScript
http://code.google.com/p/jspdf/
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!