sbutler Posted January 18, 2005 Posted January 18, 2005 I have read many posts about printing records to a PDF file and emailing. I have evaluated AfFiler and pdf995, but haven't been able to do what I need to. I have a quote system (Windows FM7) and need the ability to hit a button to automatically e-mail a quote in PDF format. The script needs to print the quote as a PDF, automatically name it "Quote Number XXXX" (from a field on the quote) and automatically email it to the customer based on the e-mail address field on the quote. All of this without user intervention (well, it may be good for the user to see the e-mail message before it is sent just in case they want to add some comments or maybe copy another person - but I don't want them to have to choose the printer or name the file, etc.). The print to PDF part seems to work OK, but how do I get the Send Mail function to attach the newly created PDF file each time? I am perplexed. Will I need a plugin such as Troi? Thanks in advance for any advice! -Scott
transpower Posted January 18, 2005 Posted January 18, 2005 You need to use the Send Event function, first, to copy the PDF to the default file.
sbutler Posted January 18, 2005 Author Posted January 18, 2005 In Send Event, how do I specify the PDF file by name? As I am writing the script, the file does not exist yet... and when the file is created the name will be always be different. Could you give me an example? Thanks...
QuinTech Posted January 19, 2005 Posted January 19, 2005 Hi, Scott. You might try looking into pdfFactory. They have some sort of automatic emailing built in to their pdf writer. I haven't used it and i'm not sure exactly how automatic it is, but i know it is a feature. HTH, Jerry
transpower Posted January 19, 2005 Posted January 19, 2005 sbutler: Search the forums for "Send Event" and you'll see some specific examples on how to do it.
stuj1026 Posted January 19, 2005 Posted January 19, 2005 Hi Scott.. That is pretty much what we do here at our company.. You will need a number of items.. 1... Troi file plugin to rename the printed pdf to your quote number xxxx 2... SMTP plugin to send your mail from filemaker with the attached pdf with the new name ie "quotenumberxxx.pdf" 3... Change printer plugin from http://www.fmwebschool.com You can goto their website and download from there.. You will use this to change your printer to your pdf printer and as mentioned in another post and what we use is 4... PDF-Factory from http://www.fineprint.com as your pdf print driver an excellent product which when set up correctly can print to a designated folder without intervention. So the short answer is print your quote to pdf-factory by changing printers using the plugin from fmwebschool.. this will print your quote as a pdf using the name of you database to lets say a folder called pdf_files Use troi to rename the file in pdf_files folder to your quote#.pdf use smtp plugin to sent to designated email with the attachment.. Works like a charm.. all the plugins and pdf factory will probably set you back about $120 but well worth it after you put the whole deal together Hope this helps Stu
sbutler Posted January 20, 2005 Author Posted January 20, 2005 Thanks very much, I'm getting right on it! -Scott
sbutler Posted January 21, 2005 Author Posted January 21, 2005 Stu, I am trying demo versions of FM Printer Select and PDF Factory as you suggested. I decided against using unique filenames for each quote and saving them, so I am not using Troi at this time. I will use the same name and have it overwrite each time. I got it to work fairly well, but have a few glitches. When I open the file and initiate the first print, it brings up the FM Printer Select Printer Start-up screen and pauses for about 15 seconds (is this because it's unregistered?). I also get some intermittent problems where the print dialog for PDF factory was popping up, even though I have it turned off in the printer preferences. Have you had any of these issues? Also, my script initiates the print to PDF, and then emails the PDF to the customer. I had to insert a 10 second "Pause/Resume Script" to give the PDF time to finish printing before the Send Mail tried to grab it. Did you need to do the same? Is this the only way to make it pause before mailing? All it does is put the Continue/Cancel buttons on the left side while it pauses... I would rather have a message pop up while it pauses, and a countdown would be awesome! Thanks for any info you can provide. -Scott
stuj1026 Posted January 24, 2005 Posted January 24, 2005 Well your on the right track. The 15 second pause is the unregistered product of change printer. We had some pausing issues as well .. We used a loop in our script for timing which would allow you not to have the continue button on the side.. You will have to experiment with that one. We use troi as well to check the file size of the pdf to make sure that the file is written to disk before we issue the mail script.. We used exit loop if file size > 200.. So there is some experimentation needed.. We did not have the problem with the printer dialog comming up? not sure about that one but it could be the change printer plugin.. your 3/4 the way there.. let me know how it works out Stu
Recommended Posts
This topic is 7585 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now