Page 1 of 1

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

Posted: Tue Apr 30, 2013 2:42 am
by Jamesplank
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

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

Posted: Thu May 02, 2013 3:49 pm
by Klaus
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