Reading PDFs in LC (again)
livfoss at mac.com
Fri Oct 7 10:40:37 CDT 2011
Folks, I have been reading all the responses I got on this issue that appeared under a number of different subject headings in the last couple of weeks. I thought people might be interested in my current position.
First, my intention was to read PDFs as images (bitmaps) into an LC-authored app written to be run under Windows. This is clearly quite a restricted way of using PDFs, since they can contain readable text and much else which I don't currently care about. However, even with these restrictions it is not an easy thing to code a reader for PDFs entirely in LiveCode, so some third-party component appears to be needed.
Second, I also had another need for input of bitmaps, which was to read TIFF files. In my original posts I didn't explain this as I thought it would complicate the discussion. Sadly this is another format that LC doesn't help us with.
Third, I needed generous licensing terms, so that the additional component(s) to accomplish the input would be either free or else licensed on a pay-once basis, without per-user charges imposed on the end user, much like LC itself.
Fourth (and last), I am writing an app for busy non-technical people which means among other things that any installation process should be simple, and certainly without any kind of extended interaction about options, licensing terms etc. demanded of the user.
I have considered various approaches, with ImageMagick being the technical front runner (it's 'free' - kind of - and fulfils my technical requirements).
I was scared of ImageMagick both because of the Windows-specific technical warnings on the download site and because of the license terms.
The good news is that people on this list have persuaded me that I should not be scared. There is still some question over the license terms, since the one commercial supplier of the main underlying component, GhostScript (Artifex), insists that:
> If your application (including its source code) is not licensed to the public under the GNU GPL, you are not authorized to ship GPL Ghostscript or GPL MuPDF with your application under the terms of the GNU GPL if any one of the following is true:
> your application contains a copy of some or all of GPL Ghostscript or MuPDF;
> your application is derived from, is based on, or constitutes a revision of some or all of GPL Ghostscript or MuPDF;
> your application includes one or more functions that use some or all of GPL Ghostscript or MuPDF.
> These criteria apply to your application as a whole. Even if only one section of your application satisfies one of these criteria, you are not authorized to ship GPL Ghostscript or GPL MuPDF with your application unless your application, including all of its source code, is licensed to the public under the GNU GPL.
> If your application (including its source code) is NOT licensed to the public under the GNU GPL and you intend to distribute Ghostscript or MuPDF to a third party for use with and usable by your application, you MUST first obtain a commercial license from Artifex.
Various people on the list have suggested that there are workarounds that render this statement untrue, and since there appear to be real-world examples of commercial products that do use GhostScript without a commercial license, I am going to adopt the approach suggested, hopefully maintaining the letter and spirit of the GPL.
OK, the next thing is to try it - probably not using 'shell' (heeding Monte Goulding's warning and adopting his solution, which sadly I only half understand). I have command-line fear, but I guess I'll get over it (when I started programming computers, we didn't even have command lines - sounds like a Monty Python sketch, but true. The machines were not actually steam powered).
I'll report back if I get to a point where my app (including its install process) appears viable.
More information about the use-livecode