mobilecomposemail pdf attachment

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
drunblut
Posts: 7
Joined: Mon Jun 15, 2020 10:29 pm

mobilecomposemail pdf attachment

Post by drunblut » Wed Feb 17, 2021 11:42 am

Hi,

i printed the content of a card into pdf-file in specialfolderpath("documents"), no problems.

Code: Select all

global dbid, sql, tergebnis, tdatei

on mouseUp pMouseButton
   local tAttachment
   open stack "printpdf" of stack "Logbuch"
   
   put specialFolderPath....
   
   open printing to pdf tPDFPath
   set printpaperorientation to "landscape"
   
   if the result is "Cancel" then
      ## The user has cancelled printing
      exit mouseUp
   else
      ## Print the card into the printable area
      print card "cardprintpdf" of stack "printpdf" of stack "Logbuch" into 10,50,812,547
   end if
   go to card "cardprintpdf" of stack "printpdf" of stack "Logbuch"
   close printing
   close stack "printpdf" of stack "Logbuch"
end mouseUp
Then i wanted to send the file by mail.

Code: Select all

if the environment is "mobile" then
      put "mypdffile" into tAttachment["name"]
      put "xxx" into tsubject
      put "mymailaddress" into temail
      put "yyy" into tbody
      put specialFolderPath("documents") & "/" & mypdffile into tAttachment["file"]
      put "application/pdf" into tAttachment["type"]--
      mobileComposeMail tsubject, temail, , , tBody, tAttachment
   end if
The mail is sent correctly but the attached pdf file is stretched. It seems that the visible (on android mobile) part of the file is stretched to 10,50,812,547.

Has anyone got an idea how to manage this? I already tried snapshot but got also only the visible part in the png-file.

Grets Andreas

Klaus
Posts: 12204
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: mobilecomposemail pdf attachment

Post by Klaus » Wed Feb 17, 2021 12:08 pm

HI Andreas,

welcome to the forum!
This is the ANNOUNCEMENT forum, so I will move thit thread to the "Talking Livecode" forum. 8)


Best

Klaus

drunblut
Posts: 7
Joined: Mon Jun 15, 2020 10:29 pm

Re: mobilecomposemail pdf attachment

Post by drunblut » Wed Feb 17, 2021 1:09 pm

Hallo Klaus,

sorry, didn`t get that. Thanks for moving my post. Have you got any ideas?

Grets Andreas

Klaus
Posts: 12204
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: mobilecomposemail pdf attachment

Post by Klaus » Wed Feb 17, 2021 1:29 pm

Hi Andreas,

no, I don't develop for mobile, don't even own a cellphone. :-)


Best

Klaus

drunblut
Posts: 7
Joined: Mon Jun 15, 2020 10:29 pm

Re: mobilecomposemail pdf attachment

Post by drunblut » Thu Feb 18, 2021 9:59 am

Hi again,

is there nobody with an idea for solving my problem? Thanks in advance for any hint!

Grets Andreas

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5838
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: mobilecomposemail pdf attachment

Post by jacque » Thu Feb 18, 2021 6:58 pm

This sounds like it might be a LC issue. I'd submit a bug report at quality.livecode.com and see what they think.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

drunblut
Posts: 7
Joined: Mon Jun 15, 2020 10:29 pm

Re: mobilecomposemail pdf attachment

Post by drunblut » Fri Feb 19, 2021 12:26 pm

Hi Jacque,

thanks a lot, i will follow the bug report.

Grets Andreas

drunblut
Posts: 7
Joined: Mon Jun 15, 2020 10:29 pm

Re: mobilecomposemail pdf attachment

Post by drunblut » Fri Feb 19, 2021 12:57 pm

Hi Jacque,

for better understanding i attach the file "pdffile" which is created in lc correctly and file "mailedpdffile".

Thanks for your help.

Grets Andreas
Attachments
pdffile.gif
mailedpdffile.gif

drunblut
Posts: 7
Joined: Mon Jun 15, 2020 10:29 pm

Re: mobilecomposemail pdf attachment

Post by drunblut » Fri Feb 19, 2021 2:48 pm

Hi Jacque,

another hint. I tried it with snapshot. The mailed jgp file shows only the visible part of the card (on android screen).

Grets Andreas
Attachments
Toerndaten.jpg

PaulDaMacMan
Posts: 360
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: mobilecomposemail pdf attachment

Post by PaulDaMacMan » Wed Feb 24, 2021 10:43 pm

Stretching a rect to fill another rect of a different size is the behavior I would expect. Is your card size the same as the area of the rect you're printing into? Maybe you can lock screen and make it that size temporarily if needed?

Have you checked out the other printing keywords in the LC dictionary?
These look like they might help:
get the printRectangle
get the printPaperRectangle
set the printMargins to left, top, right, bottom
set the printPaperScale to number
set the printPaperSize to width, height
get/set the printScale to ratio
get/set the formatForPrinting of stack to {true | false}
get/set the printPaperOrientation to {"portrait" | "landscape" | "reverse portrait" | "reverse landscape"}
get/set the printGutters to columnSpace, rowSpace
get the printerSettings
set the printerSettings to string

I don't do any printing from Android so I don't really have definite answers here, just suggestions.
My LCB Repos: https://github.com/PaulMcClernan/
My LiveCode YouTube Videos: PlayList

Post Reply

Return to “Talking LiveCode”