Page 1 of 1

Printing to PDF - wants the card to be open

Posted: Sun Jul 27, 2014 5:26 pm
by p0ntif
I currently have a program running where I ask for a bunch of user input and then save it to a PDF.
However, since this is to be a mobile application that creates a full size printable PDF, I am using a substack of the appropriate A4 paper size and saving that.
Unfortunately it will not create a PDF unless that card is open. is there a way around this? Thanks in advance!

I have scripted a button for creating the PDF is as follows:

Code: Select all

  
On mouseUp
ask file "Save PDF as:" with "PDF.pdf"
   if it is empty then exit mouseUp
   open printing to PDF it
   print card 1 of stack "surveyss" into the printRectangle
   close printing
end mouseUp

Re: Printing to PDF - wants the card to be open

Posted: Sun Jul 27, 2014 10:20 pm
by Mark
Hi,

You can't print a card or stack that isn't open, but you can print hidden stacks:

Code: Select all

on mouseUp
  ask file "Save PDF as:" with "PDF.pdf"
   if it is empty then exit mouseUp
   lock messages
   go inv cd 1 of stack "surveyss"
   unlock messages
   open printing to PDF it
   print card 1 of stack "surveyss" into the printRectangle
   close printing
   lock messages
   close stack "surveyss"
   unlock messages
end mouseUp
Kind regards,

Mark

Re: Printing to PDF - wants the card to be open

Posted: Sun Jul 27, 2014 11:04 pm
by p0ntif
Excellent! thank you!