print to pdf creating corrupt pdf on mac: a bug?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Jamesplank
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 23
Joined: Sat Jul 09, 2011 10:03 am

print to pdf creating corrupt pdf on mac: a bug?

Post by Jamesplank » Tue Apr 30, 2013 2:42 am

ANyone else come across print to pdf creating a corrupt cross platform pdf file when done on the mac?
ie can view on mac , but corrupt on PC?

I have mac and pc versions of livecode 6.0
and the same code as below "printSomeCards"...
this creates pdfs that are happy on pc AND mac if made on pc BUT
if made on mac, pdf is happy to open only on mac and NOT PC?
ie made on Mac and PDF is corrupt for PC
could be a bug?
I dont know where to report bugs now with commercial and open source?

on printSomeCards
set the defaultfolder to specialFolderPath("desktop")
open printing to pdf defaultfolder & "\pdftest5.pdf"
if the result is "Cancel" then exit printSomeCards

set the printPaperSize to "595,842"
print card "cardServerContact" of this stack into 0,0,1250,800
close printing -- send group of cards to printer
end printSomeCards

regards James

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

Re: print to pdf creating corrupt pdf on mac: a bug?

Post by Klaus » Thu May 02, 2013 3:49 pm

Hi James,

send bug reports to: bugs@runrev.com

No idea what goes wrong but here some thoughts:
1. you have a BACKSLASH in your pathname, but Livecode ALWAYS uses the (Unix) SLASH as path delimiter!
...
open printing to pdf defaultfolder & "\pdftest5.pdf"
...

And do not add "the defautlfolder" to a concatenated pathname after setting it, since this is already THE DEFAULTFOLDER :D
...
set the defaultfolder to specialFolderPath("desktop")
open printing to pdf "pdftest5.pdf":
...

I use to put the pathname into a variable, so I can check the path when debugging!
And no need to set the "defaultfolder" anyway :D
...
put (specialFolderPath("desktop") & "/pdftest5.pdf") into tTargetFile
open printing to pdf tTargetFile
...

2. you are printing into a larger rect than the papersize?


Best

Klaus

Post Reply