Missing PDF component?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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

Missing PDF component?

Post by dunbarx » Tue Apr 04, 2017 10:47 pm

If I print a file to pdf, using the "open printing to pdf" command, in a Mac standalone there is no issue. But a standalone for Windows (Windows 7) requires Adobe Acrobat (or perhaps some other pdf writer) in order for the pdf to be generated and saved at all.

No error is thrown, but no .pdf file is created. This drove me nuts. Do I have this wrong, or am I doing something wrong?

Craig Newman

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

Re: Missing PDF component?

Post by FourthWorld » Wed Apr 05, 2017 12:17 am

Nothing in "the result"?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: Missing PDF component?

Post by dunbarx » Wed Apr 05, 2017 2:27 am

Richard.

Nothing. I placed queries all through the handler that does this when I was trying to track down the problem. I used "answer folder" to select a pathname to save to, and placed result checkers all around that and also all over the actual "open printing to pdf" section. All results are empty.

This makes sense, because the Mac does not care at all. No issues. That is what threw me.

If I run the Windows standalone on a machine that has Acrobat Pro resident, that machine works just fine. I was surprised at this, and it was only by luck that I tried running the standalone on that particular machine. If I had started there, I never would have known there was an issue.

I assumed that the pdf printing library in LC was all that was needed to create a viable pdf file in any platform. Unless I am doing something wrong, at least on Windows 7, this is not so.

Craig

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

Re: Missing PDF component?

Post by dunbarx » Wed Apr 05, 2017 3:35 pm

It is more than that no error is thrown. In the standalone, I create both a pdf and a text file, saved to a folder of the user's choice. If I write and save the textFile before the pdf, that is, earlier in the handler, the text file is indeed created and saved, but the pdf is subsequently not. If I reverse the two operations, neither is saved. So the handler "aborts" or fails somehow without finishing.

This means that without Acrobat Pro on a Windows 7 machine, when the command "open printing for pdf" is executed, the handler must simply end. That an external program, or rather, absent that program can affect the proceedings of a running handler seems bizarre to me. I could understand if the pdf simply failed to be created, I think, but not this.

Watch this space.

Craig

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

Re: Missing PDF component?

Post by FourthWorld » Wed Apr 05, 2017 5:21 pm

If you're experiencing an error that's not being reported, that's a bug. Please consider submitting your recipe to the bug DB.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 367
Joined: Mon Jun 10, 2013 1:32 pm

Re: Missing PDF component?

Post by Lagi Pittas » Wed Apr 05, 2017 6:58 pm

Hi Craig

If it helps I have an invoice application I wrote for a colleague and that runs perfectly on the 3 machines I have run it on.
None have Acrobat Reader on and I refuse to Use Adobe Reader Bloatware (and Norton Crapware if you must know). All these systems have the free Sumatra PDF reader.

there are even more pluses other than the small size it will read Mobi, EPUB, Djvu and CBZ/CBR comic books but I bet you already know that.

Regards lagi

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

Re: Missing PDF component?

Post by FourthWorld » Wed Apr 05, 2017 7:32 pm

Lagi Pittas wrote:Sumatra PDF reader.
Super-cool tip, Lagi - thanks! Not only free, but handles eBook formats as well. I'll be putting it to use...
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: Missing PDF component?

Post by dunbarx » Wed Apr 05, 2017 9:07 pm

Lagi.

Thanks. i will check it out.

Craig

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

Re: Missing PDF component?

Post by jacque » Thu Apr 06, 2017 5:01 pm

Creating a PDF is a complex operation and it makes sense for LC to pass it off to another app to do the work. OS X has native capability so it will always work there. Other OSs will need a helper app.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: Missing PDF component?

Post by dunbarx » Thu Apr 06, 2017 5:34 pm

Jacque.
Other OSs will need a helper app.
Well and good. I think I will suggest that this little piece of information be included in the dictionary.

Craig

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 367
Joined: Mon Jun 10, 2013 1:32 pm

Re: Missing PDF component?

Post by Lagi Pittas » Thu Apr 06, 2017 9:01 pm

How does a PDF reader become a helper app for writing pdfs or is it using Firefox or chromes internal code?

Regards Lagi

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

Re: Missing PDF component?

Post by Klaus » Fri Apr 07, 2017 11:02 am

I always thought PDF export would be "self contained" since LC supplies a "revpdfprinter.dll" of 1.1 MB!
Not? :shock:

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 367
Joined: Mon Jun 10, 2013 1:32 pm

Re: Missing PDF component?

Post by Lagi Pittas » Fri Apr 07, 2017 11:45 am

HI

I was sure it couldn't be as there is no fragment of ADOBE on my machines and there is no way that Sumatra PDF is going to have an API that LC cooulkd use even if it coulkd do other than read PDFs but .... You never know.

So I Booted my Virtial XP removed Sumatra created a simple program with a Button that

Code: Select all

Open printing to pdf "c:\pdf\test.pdf" 
print card
When I checked the file was 0 Bytes then I remembered - add

Code: Select all

close Printing
Ran it again and the file was 15K in size.

Reinstalled Sumatra PDF (20 seconds) and the PDF opens.

So Good news and bad news Craig - No it doesn't need a helper is the Good News , The bad news is you still have a problem.

Regards Lagi

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

Re: Missing PDF component?

Post by dunbarx » Fri Apr 07, 2017 3:15 pm

Well.

Good news? Bad news? Who has the time?

It turns out that the "revpdfprinter.dll" was of course included in the standalone build, but that another file, of about 4K, named "_revpdfprinter.dll" was as well. No idea where this could have come from, but it was placed in the folder which the other files, and did not work. I did not create this thing, and I have it. I may try to open in a text editor and see what it contains. But in the end I do not care.

Sorry to have caused such a ruckus.

Craig

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 367
Joined: Mon Jun 10, 2013 1:32 pm

Re: Missing PDF component?

Post by Lagi Pittas » Fri Apr 07, 2017 3:38 pm

Hi Craig

None of us has the time , but I tested it out just in case - I was pretty sure that it was not the case but at least I know for sure.

Glad it's all working.

Lagi

Post Reply