iOS Print

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: iOS Print

Post by monte » Tue Mar 06, 2012 9:14 pm

Nah, they could implement and test that in a few hours if they want something short term.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: iOS Print

Post by monte » Wed Mar 14, 2012 9:44 am

Hi

Just letting you know I've added the document interaction external to mergExt.com. The document preview will allow the user to print all the ios supported document types like PDF, office, iWork etc.

Cheers

Monte
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

seaniepie
Posts: 154
Joined: Wed Sep 07, 2011 10:56 am

Re: iOS Print

Post by seaniepie » Mon Mar 26, 2012 9:34 pm

Hi
I'm trying to print and have the following:

Code: Select all

on mouseUp
   put specialFolderPath("Documents") & "/printTemp.pdf" into tPDFFile
   delete file tPDFFile
   open printing to pdf tPDFFile
   print this card from 10,10 to 100,100
   answer "printing"
   close printing
end mouseUp
I've used the 'answer "printing" ' so that I can breakpoint on the iOS simulator. It's during the 'Print this card' line that the app crashes every time. Is anyone else getting this too? I've tried with and without the from..to with no joy.

Thanks in advance
Sean

CALL-151
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 206
Joined: Wed Oct 20, 2010 11:00 am

Re: iOS Print

Post by CALL-151 » Mon Mar 26, 2012 9:43 pm

Looks to me like your code should work. There's a bug in LC 5.0.2 (can't recall if it's in earlier versions) that will cause PDF printing to fail if there are any graphics effects applied to objects on the card being printed. This has reportedly been fixed in LC 5.5.0 but I haven't tested it yet. If you're using a version prior to 5.5, remove all graphics effects before using "Print this card".

seaniepie
Posts: 154
Joined: Wed Sep 07, 2011 10:56 am

Re: iOS Print

Post by seaniepie » Mon Mar 26, 2012 10:17 pm

Ahh, brill. I stopped using 5.5 because some of the other features were broken. I will try it out tho to see if that is the problem and if it is fixed.

seaniepie
Posts: 154
Joined: Wed Sep 07, 2011 10:56 am

Re: iOS Print

Post by seaniepie » Mon Mar 26, 2012 10:26 pm

Nope, still crashes in the very latest LC5.5. Even in a clean stack with only one button and no effects. I'll report it.
Pi

CALL-151
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 206
Joined: Wed Oct 20, 2010 11:00 am

Re: iOS Print

Post by CALL-151 » Mon Mar 26, 2012 10:49 pm

This works for me in 5.0.2 and 5.5.0.

Code: Select all

 on mouseUp
   set the defaultFolder to specialFolderPath("Documents")
   ask "Save this PDF as:" 
   if the result is "Cancel" then exit mouseUp
   put it & ".pdf" into tFile
   set the printPaperOrientation to "landscape"
   open printing to pdf tFile
   print this card from 0,0 to 1024,768 into 0,0,800,600
   close printing
end mouseUp

seaniepie
Posts: 154
Joined: Wed Sep 07, 2011 10:56 am

Re: iOS Print

Post by seaniepie » Tue Mar 27, 2012 2:56 am

Thanks for that,

Just tried it with no luck, still crashes. Is that in iOS for you?

CALL-151
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 206
Joined: Wed Oct 20, 2010 11:00 am

Re: iOS Print

Post by CALL-151 » Tue Mar 27, 2012 2:22 pm

Yes, a single 1024X768 card (attached). Are you sure that you're selecting the PDF printing external in the "build for iOS" standalone settings?
Attachments
pdf printing.livecode.zip
(2.23 KiB) Downloaded 281 times

seaniepie
Posts: 154
Joined: Wed Sep 07, 2011 10:56 am

Re: iOS Print

Post by seaniepie » Tue Mar 27, 2012 3:40 pm

Hi
Yes, I even checked inside the compiled app and see the pdf print lib file there. Thomas McGrath on the dev forum helped out tho with an alternative script which I'll be trying out later today. I'll of course let you know how I get on. He's effectively using export snapshot to PNG then using the rreHardcopyPrintPDF external to print the PNG (because it prints more than just pdf's) to an AirPrinter.
As it turns out, having just got word back from the client, we'll probably have some pre-made pdfs that I can include in the App to print directly from so I don't need to do the card-to-pdf route meaning I can avoid the 'print this card' line.
Thanks though
Sean

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm

Re: iOS Print

Post by gpb01 » Mon Apr 02, 2012 3:44 pm

CALL-151 wrote:... how about AES256 encryption for those docs that are being sent to other apps. The RunRev team seem to be having problems porting encrypt/decrypt to iOS.
Hi CALL-151 ... still need AES256 on iOS ?
I prepared an external and I'm searching for a beta-tester so, if you are still interested, please contact me by e-mail : guglielmo (at) braguglia (dot) ch :)

Guglielmo

Post Reply