开发者

Want my formated DIV to be converted to PDF and sent through email on a single click. Is it possible?

开发者 https://www.devze.com 2023-03-27 21:04 出处:网络
I have a PHP page powered by jQuery. A singel page has four steps, controll开发者_运维技巧ed by jQuery.

I have a PHP page powered by jQuery. A singel page has four steps, controll开发者_运维技巧ed by jQuery.

In diffrent steps, user selects two Images from two galleries (step 1 & 2), fromats a table by arranging divs inbetween (setp 3) then filling a form (step 4).

I want: when user clicks "Finish" on step 4. All the above information be converted to PDF and emailed to the provided email address.

Please suggest me idea, tool, plugin or code to do so!


The last time that I tried to auto-generate PDFs as you mentioned, I used a php library called fpdf. As I recall, it was difficult and cumbersome. My lack of knowledge/experience/patience definetly made me not have much fun working with it. Give it a shot and see if looks like it is feasible for you. The site has some getting started examples, and a quick Google search should yield some examples too. URL: http://www.fpdf.org/

I just stumbled across another library that looks promising: http://code.google.com/p/dompdf/ I have not used it, but, if I need to do this again in the future, I would try this before going back to fpdf.

I don't know of any javascript/jQuery plugins that can generate a PDF, so I think you are stuck with PHP in this scenario.

Hope that helps a bit!

EDIT: The email part is simple, I really like Swift Mailer: http://swiftmailer.org. It is simple to use, lots of examples, and supports a variety of options, like, attachments. Also handles the encoding issues that generally plague emails sent directly from php mail().

One more thing, if you are not too far into development, take a look at using Kohana as a php framework. It's light and easily extensible. They follow decent coding standards, and have an active open source community. Plus, there is a module for SwiftMailer that almost sends the mail for you-Not really...but I think you get the point. ;)


Have a look at http://andreasgal.github.com/pdf.js/

0

精彩评论

暂无评论...
验证码 换一张
取 消