Livecode???? and .SPL files

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

tal_is_back
Posts: 26
Joined: Thu Feb 23, 2012 7:09 pm

Re: Livecode???? and .SPL files

Post by tal_is_back » Sun Feb 26, 2012 4:19 pm

Hi,

Sorry but write a browser is over my abilities.

Tal

tal_is_back
Posts: 26
Joined: Thu Feb 23, 2012 7:09 pm

Re: Livecode???? and .SPL files

Post by tal_is_back » Mon Feb 27, 2012 11:53 am

Hi,

I have changed the configuration printer to winprint/EMF instead of zimfprint/raw,the printing doesnt work anymore, it prints many pages containing unreading chars.

I think it might be my printer problem, cause i have read that winprint should be the normal processor and zimf the help processor.

If someone has a printer at home, could he test which printer processor does he use?

Thanks

tal_is_back
Posts: 26
Joined: Thu Feb 23, 2012 7:09 pm

Re: Livecode???? and .SPL files

Post by tal_is_back » Tue Feb 28, 2012 4:19 pm

Hi,

Me again, sorry to post many times but i think i have found something interessant.
Reading job data

Access to the data of a SPL spool file, can be implemented quite easily from within a print processor.

To access the spool stream use the OpenPrinter function, where you specify “PrinterName,Job xxxx” for the pPrinterName parameter. The returned hPrinter handle can be used to read the job data via the ReadPrinter function.

If the printername is "Lexmark W820" and the JobId is 3, the string to be used would be "Lexmark W820,Job 3"

For more information on this see the SDK documentation for OpenPrinter and ReadPrinter.

Information about the SPL file format can be found here: SPL Files.
Does anyone know how i can use that command? thanks

tal

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Livecode???? and .SPL files

Post by Mark » Tue Feb 28, 2012 4:31 pm

Hi Tal,

Apparently, you quoted from some documentation for C or VB programmers. To use that SDK, you might need to create an external. At my company works an expert who might be able to do this, but it's going to cost you something. If you're interested, you can contact me here.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Livecode???? and .SPL files

Post by sturgis » Tue Feb 28, 2012 4:55 pm

You'd have to write a program (in a language other than livecode) to write a print processor.

I don't know if it'll help but I was poking around a bit. If you right click your printer, choose printer properties, advance tab, theres a button at the bottom of the screen that says 'print processor.' You might try different processor settings in there to see if you can end up with a format of the spl files that you can parse. And of course hope that other things don't break in the process. (Should be able to set things back to how they were worst case) If you find a method that will create spl files you can get data out of, you'd have to change every machine to match.

I was also thinking of one other thing. When the ticket is generated is it created as an image? (meaning no text to parse)?

Still would be easier to create your own browser so that you can have a big "extract the data and save it to a file" button. Or even automate it so that when the final URL is loaded after print, the data is saved automagically but /shrug.

Could the info be handled with a scanner and OCR software from the printed ticket?

The best option would still be to have it changed on the server side with ticket transactions logged automatically.

tal_is_back
Posts: 26
Joined: Thu Feb 23, 2012 7:09 pm

Re: Livecode???? and .SPL files

Post by tal_is_back » Tue Feb 28, 2012 4:57 pm

ok thanks, but i think i can do it by myself with windev or other ;)

tal

tal_is_back
Posts: 26
Joined: Thu Feb 23, 2012 7:09 pm

Re: Livecode???? and .SPL files

Post by tal_is_back » Tue Feb 28, 2012 6:13 pm

Hi sturgis,

I have already tried to changed the print processor, but the printing doesnt work anymore if i do that pitty (maybe i could check other printer drivers)

For writing a program which wil extract data from the printer processor, its good idea and i am looking for that...

To write my own processor, it will be good too, but i dont know how to begin, can you give the first keys to do that?

Tal

tal_is_back
Posts: 26
Joined: Thu Feb 23, 2012 7:09 pm

Re: Livecode???? and .SPL files

Post by tal_is_back » Tue Feb 28, 2012 6:14 pm

To write my own processor, it will be good too, but i dont know how to begin, can you give the first keys to do that?
I meaned to write my own browser sorry

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Livecode???? and .SPL files

Post by sturgis » Tue Feb 28, 2012 6:33 pm

Look at revbrowseropen and all the other associated stuff in the dictionary. Look at revbrowserset and revbrowserget. Also if you click the resources button on the main livecode bar under "internet" on the left is a browser sampler that has lots of useful stuff that should help you learn the ins and outs.

I have no way of knowing if you need to handle popups etc, and i've never done that part of the browser stuff, but the basic browser functionality is pretty easy.

There is LOTS and lots of info available in the dictionary stuff like browserbeforenavigate, browserdocumentcomplete, etc. Lots to read but the pieces fit together pretty well so hopefully it won't be too difficult for you to get something up and running.

tal_is_back
Posts: 26
Joined: Thu Feb 23, 2012 7:09 pm

Re: Livecode???? and .SPL files

Post by tal_is_back » Tue Feb 28, 2012 6:37 pm

you mean i can do it on livecode, good ill check it, first ill try to execute the extracting commands i have found, ill send it to your own mail address if you wanna check, and maybe youll have idea to do it easily, thanks

Tal

Post Reply