open printing to pdf problem

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
Geoff.Macumber
Posts: 30
Joined: Tue Aug 12, 2014 7:15 am
Contact:

open printing to pdf problem

Post by Geoff.Macumber » 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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: open printing to pdf problem

Post by jacque » Fri Dec 12, 2014 6:15 pm

Did you include the printing library in standalone settings?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Geoff.Macumber
Posts: 30
Joined: Tue Aug 12, 2014 7:15 am
Contact:

Re: open printing to pdf problem

Post by Geoff.Macumber » Fri Dec 12, 2014 9:11 pm

Hi Jacque,

Yes I did. I also tried setting and unsetting format for printing in the stack properties, including the path for the revpdfprinting.dll in the stand alone settings and checked the print library in stand alone general settings. Nothing I do changes anything. Works fine in IDE but not in stand alone.

Rgds Geoff.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: open printing to pdf problem

Post by jacque » Sat Dec 13, 2014 6:59 am

Look in the compiled standalone folder for a file named "revpdfprinter.dll". Does it exist? It does sound like the library isn't loading for some reason. I'm not sure what you mean when you say, "including the path for the revpdfprinting.dll in the stand alone settings" -- do you mean you already looked for that file?

If that file isn't there, you can try copying it from the LiveCode app to your standalone folder. I'm not on a Windows machine to check, but it should be in the LC app folder somewhere around here: Tools/Runtime/Windows/x86-32/Support/

If a missing file isn't the problem, add a debugging line to your standalone after the open printing statement:

Code: Select all

open printing to pdf tPDF
answer the result -- ADD THIS
That may give you the reason it fails. You can remove that line after testing.

BTW, unless some of the script later on requires it, you don't really need gHomePath since you're providing a complete file path for the pdf.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Geoff.Macumber
Posts: 30
Joined: Tue Aug 12, 2014 7:15 am
Contact:

Re: open printing to pdf problem

Post by Geoff.Macumber » Sun Dec 14, 2014 11:06 pm

Hi Jacqui,

I will try copying the dll to the folder where the stand alone lives and see what that does. As for putting the capture of the result I already tried that but LiveCode did not return from the "open printing to pdf..." statement. I agree with what you said about the dll not being loaded. In the stand alone settings under copy files I included the path to the revpdfprinter.dll but it didn't fix the problem. I tried your suggestion of putting the revpdfprinter.dll into the folder where the stand alone lives AND IT WORKED! That then solves my problem. Thank you, you are a certified genius!!!!!

However it still does not explain why the dll is not loaded into the stand alone.

Thank you umpire, thank you ball boys and thank you Jacqui!

Regards Geoff.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: open printing to pdf problem

Post by jacque » Mon Dec 15, 2014 12:23 am

You should not add the dll to the copy files section, so remove it if it is still in there. In the General pane of the standalone settings, choose to add libraries manually and then be sure that the printing library is selected in the list. The next time you do a build it should work without you doing anything else.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Geoff.Macumber
Posts: 30
Joined: Tue Aug 12, 2014 7:15 am
Contact:

Re: open printing to pdf problem

Post by Geoff.Macumber » Mon Dec 15, 2014 5:11 am

Thanks Jacque.

maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 421
Joined: Sat Jun 24, 2006 12:02 am
Contact:

Re: open printing to pdf problem

Post by maxs » Mon Oct 24, 2016 3:32 am

I can't find revpdfprinter on my mac for standalone. Do I need to download it?

Max

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10324
Joined: Wed May 06, 2009 2:28 pm

Re: open printing to pdf problem

Post by dunbarx » Mon Oct 24, 2016 3:51 am

Hi.

Jacque is far more experienced that I with this, but the pdf library is part of any LC package. It may be corrupted, but is not something "extra" that you need to download.

Jacque?

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: open printing to pdf problem

Post by jacque » Mon Oct 24, 2016 7:20 pm

maxs wrote:I can't find revpdfprinter on my mac for standalone. Do I need to download it?
Craig is right, it is included in the LC package. You only need to indicate in the standalone settings that you want to include the PDF printer in the build.

There was a bug in some versions where externals were not moved into the standalone. That has been fixed, so if you are having issues and are using an older version, try building with LC 8.1.1. You will find the PDF Printer in the Inclusions pane of standalone settings.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply