PDF export

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: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10544
Joined: Fri Feb 19, 2010 10:17 am

PDF export

Post by richmond62 »

I implemented PDF export from a field in my Devawriter Pro about 100 years ago, and that was only possible, then, to Mac.

I hope & suppose that export from a field to Windows (and Linux) is now possible.
Klaus
Posts: 14371
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: PDF export

Post by Klaus »

We only have "open printing to PDF..." in LC right now.
Is that what you mean?
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10544
Joined: Fri Feb 19, 2010 10:17 am

Re: PDF export

Post by richmond62 »

Is that what you mean?
Possibly: I'll go and try. Thanks.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10544
Joined: Fri Feb 19, 2010 10:17 am

Re: PDF export

Post by richmond62 »

No, No, No: that prints an image of a card, when what I am looking for is a PDF of the contents of a field.

https://lessons.livecode.com/a/29177-ho ... g-livecode
Klaus
Posts: 14371
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: PDF export

Post by Klaus »

Mabe there is a macOS SHELL command for this or maybe you used AppleScript?
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10544
Joined: Fri Feb 19, 2010 10:17 am

Re: PDF export

Post by richmond62 »

No: there is a relatively easy way in Mac:

Code: Select all

on mouseUp
   ask file "Save as:" with "Print.pdf"
   put it into tFileName
   if tFileName is empty then exit to top
   set the printerOutput to "file:" & tFileName
   revShowPrintDialog false, false
   revPrintField the long name of fld "GUFF"
end mouseUp
The problem is how to do that with Windows and Linux.
Klaus
Posts: 14371
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: PDF export

Post by Klaus »

Ha, had to look up "printeroutput" :-D
According to the docs that should work on: mac, windows, linux.
But doesn't?
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10544
Joined: Fri Feb 19, 2010 10:17 am

Re: PDF export

Post by richmond62 »

I don't think so, but I have not tested it since 2023.
scott_morrow
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 46
Joined: Tue Jun 27, 2006 8:35 pm
Contact:

Re: PDF export

Post by scott_morrow »

richmond62 wrote: Wed Dec 02, 2026 1:18 pm No, No, No: that prints an image of a card, when what I am looking for is a PDF of the contents of a field.

https://lessons.livecode.com/a/29177-ho ... g-livecode
open printing to pdf does in fact create normal pdf documents that can include text and images and it is NOT simply rendered as an image of a card. Text and hi-resolution graphics appear in the pdf as expected. There is a bug 22982 with using open printing to pdf which causes it to fail if an emoji is encountered while printing. In bugzilla there was some discussion about a possible workaround... place an effect (like a drop shadow) on the field with an emoji and it will then print. This workaround did allow it to print but was not actually very useful because adding the effect caused open printing to pdf to render the field as a (screen resolution) image. Perhaps you are remembering this conversation.

I use open printing to pdf on Mac, iOS and Android. The docs say it should work on Windows and Linux as well.
Elementary Software
...now with 20% less chalk dust!
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10558
Joined: Wed May 06, 2009 2:28 pm

Re: PDF export

Post by dunbarx »

I use "open to PDF" all the time on Mac without issue. Never tried to include an emoji. The resultant PDF's are ordinary in every way.

Craig
Post Reply