Printing Data grid lines to pdf

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
tasdvl9
Posts: 94
Joined: Fri Dec 06, 2013 3:55 am

Printing Data grid lines to pdf

Post by tasdvl9 » Tue Mar 10, 2015 5:53 pm

Hello All,

I'm trying to find a way to print out the text lines of my card into a .pdf file.

For instance, printing out lines 1 through 50 to card 1 work.

However, what I need is the ability to print out all of the lines in my string variable to separate pages in my .pdf file.

I have one card with a text field entry. I imagine what I would need to do is loop through the lines and when it reaches 50 print to pdf for that card.
Increment the card counter and then loop through the next 50 lines and print those to pdf after I emptied the field in my card etc etc.

Seems a bit overkill and I'm hoping there is an easier way.
Any thoughts on the best method?

Thanks!

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

Re: Printing Data grid lines to pdf

Post by dunbarx » Tue Mar 10, 2015 6:49 pm

Hmmm.

The "open printing to pdf" command will do what you want, but it assumes that each card is printed separately. Assuming you do not want to do all that loading and clearing (which would surely work, and really ought not to be too onerous), you might try to use either the "revPrintText or the "revPrintField" command, which will allow you to stay on the same card. But you will still have to parse your data into printable chunks, and reprint as needed.

But this assumes you can set your "current" or "default" printer to Adobe Acrobat, or some other pdf driver. I do this all the time in OS9, since there is the old "pdfWriter" driver for that OS. I would assume there is something similar to that in OSX, I just never had the need. In that way, "pdf" is your default printer, and printing will create a PDF instead of a piece of paper.

I think.

Craig

tasdvl9
Posts: 94
Joined: Fri Dec 06, 2013 3:55 am

Re: Printing Data grid lines to pdf

Post by tasdvl9 » Tue Mar 10, 2015 7:13 pm

Thanks, Craig!

I'l give that a shot.

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: Printing Data grid lines to pdf

Post by Monox18 » Thu Jun 02, 2022 7:30 pm

Hi guys, any updates to this with the "open printing to PDF" variation? That one seems to be supported in mobile as stated in the dictionary where the other 2 older commands are desktop only.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

Post Reply

Return to “Talking LiveCode”