How to create a desktop application to mimic what I've already written in PHP?
just looking for a point in the correct direction..
So I've developed a little application on the back end of our websites that allows the girls in our office to send out letter-headed PDF quotations to our potential clients via email.
I've done this using a simple HTML form
, the FPDF class
, and the php function mail()
It works a treat, but I'd like to take it a step further and create a desktop application so that the girls don't have to go through the login section of the website to access this functionality.
开发者_运维技巧I'm thinking Java?
Would this be a difficult mission someone who has only had web-developing experience?
It would only be the smallest/simplest of applications.
Thanks for any input :)
This is just an advice.
Since you have already developed something that works over web, reuse it.
- Convert the PDF converter into a service to upload and retrieve file. This service should return a
token_id
that can be used later to download the converted files. - Write a Java app using Swing that merely uses this web service. The logic in this application should be
(a) browse file from computer,
(b) Use web-service upload URL to upload the file and rec/eive appropriate response likeupload_token_id
and status uploaded/converted/failed,
(c) the Java app, should be able to use this token to download the converted file.
You may need to look into this for help related to uploading the file
No it wouldn't be difficult job to mimic your app to java desktop app that can be Java Swing APP
. you just need some practice on swing
. As you are doing in php
that is creating PDF and mailing it
. This task can easily be done in java swing by using Java Mail API
for emailing and IText
for pdf generation.
For reference you can read following links:
- http://www.javabeginner.com/java-swing/java-swing-tutorial
- http://zetcode.com/tutorials/javaswingtutorial/
- http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/
- http://www.oracle.com/technetwork/java/javamail/index.html
- http://java.sun.com/products/javamail/javadocs/index.html
- http://www.javacommerce.com/displaypage.jsp?name=javamail.sql&id=18274
- http://viralpatel.net/blogs/2009/04/generate-pdf-file-in-java-using-itext-jar.html
Hope this helps.
精彩评论