Open Printing To PDF

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
TerryL
Posts: 78
Joined: Sat Nov 23, 2013 8:57 pm

Open Printing To PDF

Post by TerryL » Mon Aug 29, 2016 7:23 pm

(LC 6.7.11, Win 7) Hi LiveCode experts.
I was printing to pdf using code that used to work when I received an unexpected error: execution error at line n/a (printing: Unknown destination). The script editor indicated the "open printing to pdf" line of code as the problem. Is that like Final Destination with Death and LC conspiring to do me in or at least forcing me to go with LC8? Terry

Code: Select all

on mouseUp
   open printing to pdf "Test.pdf"  --execution error: (printing: unknown destination)
   print this card
   close printing
   if there is a file "Test.pdf" then answer "Test was successful." with "OK"
end mouseUp
Last edited by TerryL on Tue Sep 06, 2016 6:17 pm, edited 1 time in total.
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/info.html

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9660
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Print To PDF Bug?

Post by dunbarx » Mon Aug 29, 2016 11:55 pm

Hi.

All looked good, so I tried it on my 6.7.9 Mac. OS 10.9.

All worked fine, as I thought. What are you seeing?

Craig newman

TerryL
Posts: 78
Joined: Sat Nov 23, 2013 8:57 pm

Re: Open Printing To PDF

Post by TerryL » Wed Aug 31, 2016 9:09 pm

Thanks for testing Craig.

Yes, I thought the routine worked in LC 6.7.9 - Win7 too...but not 6.7.11. As mentioned previously, the script editor compiles, but when run the script editor re-opens indicating an error at the "print to pdf" line. Because 6.7.x & 7x series are no longer updated, I'll just use my windows print-to-pdf program (PrimoPDF) instead. That still works fine.

Edit: I found a solution. The workaround is to launch LiveCode first, then open the .livecode file to use open printing to pdf. Tested and works with LC 6.7.10 and 6.7.11 - Win7. Terry
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/info.html

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 365
Joined: Mon Jun 10, 2013 1:32 pm

Re: Open Printing To PDF

Post by Lagi Pittas » Mon Sep 26, 2016 6:30 pm

Hi Terry

Just ran into the problem on 6.7.11.

I have been running the program in the IDE and standalone with no problems for a few weeks.

I made some additions to the program - nothing to do with printing and the problem cropped up.

I found a "fix" given by Paul with a suggestion by Monte , about making the default folder on first opening printing to the engine (i.e. where the the printing dll is in the ide) and that didn't work.

The Standalone works perfectly with or without the FIX

here is the Fix that didn't work for me - YMMV

Code: Select all

 if (the environment is "development") then -- IDE
      set the defaultFolder to specialFolderPath("engine")
   else -- standalone
      set the defaultFolder to programpath()
   end if
https://www.mail-archive.com/use-liveco ... 77083.html

Could you be a bit more precise about loading the livecode first then the file - I did that i.e. loaded livecode then loaded the main program in the IDE. What do I need to do differently?

I really don't want to be dependent on third party programs.

Kindest Regards Lagi

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”