open printing to pdf problem
Posted: Fri Dec 12, 2014 8:36 am
Hi all,
I have posted this same problem in the Windows forum but thought it might also get me some insight by posting here.
Anyway, here goes...
I have an app that relies on producing PDF files which are to be kept for later use as possible evidence in court. My problem is this: in the IDE everything works fine, but when I produce a standalone this statement does not return to the script. I have pored all over every post I can find and at one stage had a bug report in (subsequently deleted) but cannot get any PDF's to work in standalone. I have checked permissions, made sure that the sequencing of statements in the scripts is OK, I have changed where the PDF is created and even used the specialfoldepath() function but nothing works. The code is nothing special and an extract of it is below. I would appreciate ANYTHING that may help me to solve this problem. I can put debug displays before and after the open statement and in the IDE they all are displayed. In the standalone LiveCode does not return from the open printing to pdf statement.
I am currently working on Windows 8 and had previously worked on XP. The same propblem existed on both. I went back to XP with changes to see if it would work but NO. I am using Livecode 6.6.2 and will upgrade soon but we are ready to launch our product and have laid all the groundwork but we are currently dead in the water with no PDF solution.
PLEASE HELP!!!!!
The code looks something like this although it is modified here a little as this is an extract only...
function PrintTheCard
global gHomePath
put the openStacks into x
if "ReportStack" is not among the lines of x then
open invisible stack "ReportStack"
end if
put gSubscriberNo & TRbit & "_" & UserSite & "_" & IncidentNo & "_DOF" into DoiFilename
put DoiFilename & ".pdf" into PdfFilename
put specialfolderpath("desktop") & "/" & PdfFilename into tPDF
set the printMargins to 36,36,72,72
open invisible card "ReportCard"
set the defaultFolder to gHomePath
set the defaultStack to "ReportStack"
answer "BEFORE open printing to pdf..."
open printing to pdf tPDF --<< THIS IS THE PROBLEM LINE In IDE it works but not in standalone
answer "AFTER open printing to pdf..." --<< This is never executed in the standalone but is in the IDE
put field "IncidentDate" of card "MyCard" of stack "MyMainStack" into field "fldIncidentDate" of card "ReportCard"
put field "fldTimeOfIncident" of card "MyCard" of stack "MyMainStack" into field "fldIncidentTime" of card "ReportCard"
-- Another 25-30 lines of setting up data here
put field "fldSiteName" of card "MyCard" of stack "MyMainStack" into field "fldSiteName" of card "ReportCard"
print card "FuelDriveOffReport"
close printing
set the defaultStack to "MyMainStack"
end PrintTheCard
I have posted this same problem in the Windows forum but thought it might also get me some insight by posting here.
Anyway, here goes...
I have an app that relies on producing PDF files which are to be kept for later use as possible evidence in court. My problem is this: in the IDE everything works fine, but when I produce a standalone this statement does not return to the script. I have pored all over every post I can find and at one stage had a bug report in (subsequently deleted) but cannot get any PDF's to work in standalone. I have checked permissions, made sure that the sequencing of statements in the scripts is OK, I have changed where the PDF is created and even used the specialfoldepath() function but nothing works. The code is nothing special and an extract of it is below. I would appreciate ANYTHING that may help me to solve this problem. I can put debug displays before and after the open statement and in the IDE they all are displayed. In the standalone LiveCode does not return from the open printing to pdf statement.
I am currently working on Windows 8 and had previously worked on XP. The same propblem existed on both. I went back to XP with changes to see if it would work but NO. I am using Livecode 6.6.2 and will upgrade soon but we are ready to launch our product and have laid all the groundwork but we are currently dead in the water with no PDF solution.
PLEASE HELP!!!!!

The code looks something like this although it is modified here a little as this is an extract only...
function PrintTheCard
global gHomePath
put the openStacks into x
if "ReportStack" is not among the lines of x then
open invisible stack "ReportStack"
end if
put gSubscriberNo & TRbit & "_" & UserSite & "_" & IncidentNo & "_DOF" into DoiFilename
put DoiFilename & ".pdf" into PdfFilename
put specialfolderpath("desktop") & "/" & PdfFilename into tPDF
set the printMargins to 36,36,72,72
open invisible card "ReportCard"
set the defaultFolder to gHomePath
set the defaultStack to "ReportStack"
answer "BEFORE open printing to pdf..."
open printing to pdf tPDF --<< THIS IS THE PROBLEM LINE In IDE it works but not in standalone
answer "AFTER open printing to pdf..." --<< This is never executed in the standalone but is in the IDE
put field "IncidentDate" of card "MyCard" of stack "MyMainStack" into field "fldIncidentDate" of card "ReportCard"
put field "fldTimeOfIncident" of card "MyCard" of stack "MyMainStack" into field "fldIncidentTime" of card "ReportCard"
-- Another 25-30 lines of setting up data here
put field "fldSiteName" of card "MyCard" of stack "MyMainStack" into field "fldSiteName" of card "ReportCard"
print card "FuelDriveOffReport"
close printing
set the defaultStack to "MyMainStack"
end PrintTheCard