Page 1 of 1

Open Printing To PDF

Posted: Mon Aug 29, 2016 7:23 pm
by TerryL
(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

Re: Print To PDF Bug?

Posted: Mon Aug 29, 2016 11:55 pm
by dunbarx
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

Re: Open Printing To PDF

Posted: Wed Aug 31, 2016 9:09 pm
by TerryL
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

Re: Open Printing To PDF

Posted: Mon Sep 26, 2016 6:30 pm
by Lagi Pittas
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