PDF font

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
MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

PDF font

Post by MaxV » Thu Aug 08, 2013 2:14 pm

Hi all,
I'm trying to convert a stack to a PDF, in a standalone application. Unfortunately standAlone application use different (and ugly) fonts. I use:

Code: Select all

on printCards    
   put "./ProvvigioniAgenti.pdf" into tFile   
   open printing to pdf  tFile   
   go to card 1   
   print this stack       
   close printing     
end printCards

on OpenStack 
   crearereport #this delete all cards and recreate new ones
   #printer settings
   set the printMargins to "0,0,0,0"   
   set the printPaperSize to "700,930"
   set the formatForPrinting of this stack to true #it's already true, however I put this too
   printCards
   close this stack
end OpenStack
formatForPrinting is always true, but here the differences (click on the preview, the first is the IDE and the second is the StandAlone):

Image

I develop on WinXp, but StandAlone application will work on Win7, can be this the problem?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: PDF font

Post by MaxV » Thu Aug 08, 2013 2:30 pm

Even WinXp standapplication on WinXp IDE lead to the same problem...
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10062
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: PDF font

Post by FourthWorld » Thu Aug 08, 2013 2:32 pm

You might try setting the formatForPrinting property of the stack containing the data you're printing to "true". See that entry in the Dictionary for details.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: PDF font

Post by MaxV » Thu Aug 08, 2013 3:21 pm

I already did it without result. :-(
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Klaus
Posts: 14218
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: PDF font

Post by Klaus » Thu Aug 08, 2013 3:49 pm

Hi Max,

"usually" fonts are embedded into a PDF, no idea if LC works this way, too.

Looks like some fonts are not present and get replaced, are you using fonts
that are definitively installed on any Win PC like "Arial" and "Verdana"?


Best

Klaus

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: PDF font

Post by MaxV » Thu Aug 08, 2013 4:35 pm

I solved this way:
  • the stack must be closed
  • set the formatForPrinting of that stack to FALSE, this trigger something. Even if it's already set to false, you must set to false again to trigger some in livecode font events.
  • go to the stack,
  • Create or modify your cards in the stack
  • set the formatForPrinting to TRUE, this trigger again Livecode and correct fonts.
  • Now you can create PDF (or print).
the big problem for me was to realize that Livecode doesn't look for the status of formatForPrinting, but he looks at the change of status of it. The other important thing is: stack closed for FALSE, stack open for TRUE.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Klaus
Posts: 14218
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: PDF font

Post by Klaus » Thu Aug 08, 2013 4:42 pm

Ah, thanks for the hint!
This "formatforprinting" thingy was always a mistery to me :-D

Post Reply