PDF Attachment using CutePDF writer

manjusree
Member Posts: 79
I am using CutePDF writer to convert reports into PDF files. I need to attach 'Order Confirmation' report in PDF format and send it as email to the customers all in a single button click. I have searched the forum for this and found that PDF attachment is possible.What I want to know is that if I can do it using CutePDF writer. I am not sure whether the
autosave property is available with that. I think this functionality is available with some custom versions only.Any other way to do this?. Has anybody done this using CutePDF?. Any kind of help would be appreciated.
autosave property is available with that. I think this functionality is available with some custom versions only.Any other way to do this?. Has anybody done this using CutePDF?. Any kind of help would be appreciated.
0
Comments
-
I use Win2PDF, but there are others that will do it. There must be a better way (NAV 2009) but here is how I did it.
Setup a specific printer by installing Win2PDF with a specific name set to store the PDF file in a user directory with a specific name.
Set Printer Selections to print the specific report (copy of original report- in my case the Purchase Order) to the specific Win2PDF instance.
In code on the button check that an e-mail address exists, if not , prompt for it.
Then call a function in a codeunit I created to handle the PDFs:CR := 10; LF := 13; IF ERASE(Text001_FileName) THEN; PurchaseOrder.RESET; PurchaseOrder.SETRECFILTER(); REPORT.RUNMODAL(50170,FALSE, FALSE, PurchaseOrder); int := 0; REPEAT SLEEP(200); int += 1; UNTIL (int >= 10) OR EXISTS(Text001_FileName); IF int >= 10 THEN //EXIT(FALSE); ERROR('Temp PDF file not created.'); RENAME(Text001_FileName, STRSUBSTNO(Text002_PurchaseOrderFile,PurchaseOrder."No.") ); int := 0; REPEAT SLEEP(200); int += 1; UNTIL (int >= 10) OR EXISTS( STRSUBSTNO(Text002_PurchaseOrderFile,PurchaseOrder."No.") ); IF int >= 10 THEN ERROR('Temp PDF file not renamed'); SalesPerson.GET(PurchaserCD); BodyText := 'For questions regarding this order, please contact:' + FORMAT(CR) + FORMAT(LF) + FORMAT(CR) + FORMAT(LF) + SalesPerson.Name + FORMAT(CR) + FORMAT(LF) + SalesPerson."Job Title" + FORMAT(CR) + FORMAT(LF) + SalesPerson."Phone No." + FORMAT(CR) + FORMAT(LF) + 'mailto:' + SalesPerson."E-Mail"; SalesPerson.GET(PurchaserCD); bResults := Mail.NewMessage(SendToAddress,'',STRSUBSTNO('Purchase Order %1',PurchaseOrder."No."),BodyText, STRSUBSTNO(Text002_PurchaseOrderFile,PurchaseOrder."No."),TRUE); ERASE(STRSUBSTNO(Text002_PurchaseOrderFile,PurchaseOrder."No."));
Hope this helps. As long as CutePDF can be setup to write a specific file name, this setup will work. It works for me as all my users are on 5 Citrix servers, so managing the 5 printer setups is not too difficult. Would be a royal pain if all users had their own PCs where the software needed to be installed and setup.
Your mileage may vary."There are only two truly infinite things: the universe and stupidity. And I am unsure about the universe." - Albert Einstein
Corollary- Build and idiot proof system and nature will build a better idiot.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions