Help attaching a pdf from speical folder path documents
Posted: Tue Oct 04, 2011 11:29 pm
Here I have code that prints a PDF from two cards elsewhere in the stack and saves it on the phone
After the PDF is created I am trying to put it in as an attachment on the native email client. I have the email functioning and sending out a PDF but its not the file I am trying to attach. I know my code is wrong and I've spent hours tweaking it in many different ways to try and get that (specialFolderPath("documents") & "/testpdf.pdf") as an attachment. Here is that email code
I would really appreciate help, I've spent quite a bit of time try to get this to work.
Thanks!
Code: Select all
put specialFolderPath("documents") & "/testpdf.pdf" into tPDFPath
open printing to pdf tPDFPath
if the result is "Cancel" then
-- The user has cancelled printing
#exit printCards
else
--Print the card into the printable area
print card "PDFPrint1" of this stack into 0,0,575,800
print break
print card "PDFPrint2" of this stack into 0,0,575,800
end if
close printing
Code: Select all
global gvAttachment
command attachToEmail pAttachmentText, pAttachmentName
put specialFolderPath("documents") & "/testpdf.pdf" into gvAttachment["data"]
put "testpdf.pdf" into gvAttachment["name"]
put "pdf" into gvAttachment["type"]
end attachToEmail
On Mouseup
attachToEmail
--declare the variables that hold the information that is to be included in the e-mail
local tSubject, tTo, tCCs, tBCCs, tBody
--populate the e-mail variables
put empty into lvLaunchString
put "Appearance Release" into tSubject
put "Akauble@metaxpert.com" into tTo
put "Cspring@metaxpert.com" into tCCs
put "Rzimmerle@metaxpert.com" into tBCCs
put "This is your Appearance Release" into tBody
--send the e-mail
iphoneComposeHtmlMail tSubject, tTo, tCCs, tBCCs, tBody, gvAttachment
--End Email
End MouseUp
I would really appreciate help, I've spent quite a bit of time try to get this to work.
Thanks!