I am trying to create a PDF file and send it as an attachment in an email. The code I have works OK in IOS but when I run it in Android, the email is created minus the attachment.
I am not quite sure if it is creating the PDF attachment and not attaching it or if its not creating the PDF file. Is there any way I can browse and check if the PDF has been created?.
The code created is below:
global gSalesQualifier_PrimaryeMailAddress, gSalesQualifier_SecondaryeMailAddress, gProjectTitle, gEngineerName, gVisitDate, gUUID
## Load location and file name into PDF path variable
put specialfolderPath("documents") & "/SalesQualifierID " & gUUID & ".pdf" into tPDFPath
## Creat PDB file and store in PDF Print location
set the printScale to 0.95
set the printMargins to "0,0,0,0"
set the printPaperSize to "595,842"
open printing to pdf tPDFPath
print card "SalesQualifier_Print"
close printing
## Create email message and attach stored PDF file
put tPDFPath into tAttachment["file"]
put "PDF" into tAttachment["type"]
put "/Sales Qualifier ID " & gUUID & ".pdf" into tAttachment["name"]
mobileComposeMail "Sales Qualifier Report ID: " & gUUID & " - Title: " & gProjectTitle , gSalesQualifier_PrimaryeMailAddress,gSalesQualifier_SecondaryeMailAddress,, "Please find attached a copy of the Sales Qualifier Report, ID: " & gUUID & " for a sales visit dated " & gVisitDate & " relating to enquiry title " & gProjectTitle & " by " & gEngineerName & ".", tAttachment
## Co back to General Details card on completion of email send.
go card "GeneralDetails1"
close this stack
Can anyone point me in the correct direction.
Thanks
Creating and emailing PDF as attachment
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Creating and emailing PDF as attachment
Hi,
No experience with androïd but
return true/false on iOS
Best regards
Jean-Marc
No experience with androïd but
Code: Select all
put (there is a file tPDFPath)
Best regards
Jean-Marc
https://alternatic.ch
Re: Creating and emailing PDF as attachment
Thanks Jean-Marc,
The answer is no using your advice, it would appear that the PDF has not been created.
On further investigation, I have discovered that the command 'open printing to pdf' is not supported in Android, do you have any advice how to create a PDF in Android.
Thanks
The answer is no using your advice, it would appear that the PDF has not been created.
On further investigation, I have discovered that the command 'open printing to pdf' is not supported in Android, do you have any advice how to create a PDF in Android.
Thanks