Live Code 5 Pdf Printing

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
wolfkillshepard
Posts: 44
Joined: Tue Jul 12, 2011 7:43 pm

Live Code 5 Pdf Printing

Post by wolfkillshepard » Wed Oct 19, 2011 9:28 pm

Ever since I switched to LiveCode 5, when my application prints PDFs the end result is just a blank file with the correct name and type but it contains no data. Since its not truly a PDF in the end result in LiveCode 5 but it is in 4.6 I'm starting to think that something changed with the release that is breaking this section. I've read the release notes and see nothing that would affect this. If anyone knows if LiveCode 5 could cause this problem please tell. Thanks!

Note: Could it be a possible change with the way LiveCode 5 handles specialfolderpath

wolfkillshepard
Posts: 44
Joined: Tue Jul 12, 2011 7:43 pm

Re: Live Code 5 Pdf Printing

Post by wolfkillshepard » Wed Oct 19, 2011 10:53 pm

Basically the way we have it set up, there is an image area and we change the source of that to the image we want in the pdf. This method has always worked until we upgraded to 5!

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: Live Code 5 Pdf Printing

Post by Kaubs » Thu Oct 20, 2011 4:35 am

This works perfectly on Desktop but not in iOS.... Any ideas anyone? It's driving us crazy! The same code worked previously with no issues in LC 4.6.3 but this we are trying to compile in LC 5.0 and it seems broken.

Code: Select all

Command PDFPrintTwoPage
   #answer "printing"
   put specialFolderPath("documents") & "/testpdf.pdf" into tPDFPath
   
   set the printPaperSize to 640,920 -- 8.5x11 inches, US Letter size
   
   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,640,920--the rect of field "Print" on card "PDFPrint1"
      
      print break
      
      print card "PDFPrint2" of this stack into 0,0,640,920
      print break
      
      print card "PDFPrintEND" of this stack into 0,0,640,920
      
   #end if
   close printing
   #answer "ending printing"
End PDFPrintTwoPage
Thanks!

gcbrackett
Posts: 16
Joined: Sun Apr 16, 2006 6:13 pm
Contact:

Re: Live Code 5 Pdf Printing

Post by gcbrackett » Fri Oct 21, 2011 2:31 am

I can verify exactly this behavior. Here's a little additional information from my experience:

Code that previously worked fine under LC 4.6.4 now produces different results when printing to PDF using LC 5.0.0, and I'd be grateful for any ideas.

App run from LC 5.0.0 IDE: okay, PDF produced correctly on desktop
App in iPad or iPhone simulators: okay for iPhone/iPad target iOS 5.0, no pages for iPhone/iPad iOS 4.x targets
App in iPad 1 running iOS 5.0, no pages.
(I don't yet have an iPhone that will run iOS 5.)

Using the console, I can see that the card to be printed (when using the simulators 4.x) is correctly created for each page, but no page is output. The output PDF file is there, but no pages. There are no errors reported in the console when running the app in the simulators. I'm stumped.

Oh: Mac Snow Leopard, Xcode 4.2
George C Brackett
Principal, George Brackett Associates
http://luceatlux.com

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

Re: Live Code 5 Pdf Printing

Post by CALL-151 » Sun Oct 23, 2011 2:49 am

Confirmed, but on Lion (10.7.2) and LC 5.0 I can't even get it to work on the simulator running iOS 5. Works from the IDE only.

Bottom line seems to be that PDF printing in iOS is broken in LC 5.0. Unfortunately, I just updated an App and it didn't even occur to me to test PDF printing that had been working fine. Hope this bug is fixed soon.

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: Live Code 5 Pdf Printing

Post by Kaubs » Mon Oct 24, 2011 5:30 pm

I sent a stack to Run Rev to check out. They said it is in fact a bug that they will work on. I'll put an update here if I hear anything from them...tho I expect it will be another release that has the resolution. Kind of a bummer as my project relies on this functionality...it is the core of my current app.

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

Re: Live Code 5 Pdf Printing

Post by CALL-151 » Mon Oct 24, 2011 5:41 pm

Thanks. This is exactly the kind of situation that keeps me from plunking down annual $ for developer support. The working parts of this platform are great, but I keep scanning the horizon for a similarly simple iOS-centric IDE that has more robust internal quality assurance.

Post Reply