Source language: Translate to:

"Hot Folder" Printing Question

General questions about NeoBook

Moderator: Neosoft Support

"Hot Folder" Printing Question

Postby Dan Silverman » Sun Dec 28, 2014 7:04 pm

Hello. It has been a long time since I've used NeoBook, but I have a need for something specific and before I dig into trying to do this with NeoBook, I wanted to check with the experts here to see if it can even be done.

Part I:
Can NeoBook monitor a folder or folders and perform actions on new items placed in the folder(s)?

I need what photographers call a 'Hot Folder'. This is a folder that is constantly monitored by a piece of software and when a JPG is placed in the folder, an action is performed on the item. For example, a photographer has his camera tethered to the computer and the tether drops photos into a folder (we'll call it "Print1"). A piece of software monitors "Print1" and every time a new image is placed there it prints it and then moves the printed image to a new folder.

It's pretty simple, but does NeoBook have the ability to monitor a folder, detect when something new has been added to the folder, and then perform an action (such as printing) to the item and then move that item to a new folder?

Part II:
If NeoBook can monitor a folder and perform an action on new items placed within a the monitored folder, can an application created with NeoBook monitor MORE THAN 1 folder and perform different actions depending on which folder the item is placed in?

For example, let's say I have two folders, "Print1" and "Print2". "Print1" is meant to print on printer 1 and "Print2" is meant to print on printer 2. Is it possible to create an application with NeoBook that can monitor both folders and, depending on the folder an item is added to, perform the correct operation (i.e. send the image to either printer 1 or printer 2)?

Sorry if I am making this overly complicated. Please ask any questions if you need clarification. I will do my best to respond.

Thank you all in advance.
Dan Silverman
 
Posts: 18
Joined: Thu Apr 21, 2005 8:34 am

Re: "Hot Folder" Printing Question

Postby Gaev » Sun Dec 28, 2014 9:49 pm

Dan Silverman:

Can NeoBook monitor a folder or folders and perform actions on new items placed in the folder(s)?
Yes ... use the Timer Tool to to trigger Action Commands after a specific amount of time has elapsed ... you can set the Time Interval when these actions will be (repeatedly) triggered ... such triggering can be Started/Stopped with TimerStart and TimerStop commands.

So, you can setup the Trigger actions to ...

- Generate a list of files and/or folders found in a specified path using FileList
- Compare the result with a previously saved list
- act on the new names in the list
- save the current list

Part II:
If NeoBook can monitor a folder and perform an action on new items placed within a the monitored folder, can an application created with NeoBook monitor MORE THAN 1 folder and perform different actions depending on which folder the item is placed in?
Yes ... you can set up your trigger actions to ...

- generate a separate list for each specified path
or
- use a separate Timer for each specified path (easier to manage code and turn on/off individual folder actions at run time)

does NeoBook have the ability to monitor a folder, detect when something new has been added to the folder, and then perform an action (such as printing) to the item and then move that item to a new folder?
NeoBook does not have a FileMove command ... but you can have the same effect by combining ...
Code: Select all
FileCopy "source file" "destination"
FileErase "file name"
... actions.


I do not have much personal experience when it comes to printing image files ... but you can check out the following commands available in NeoBook ...
PrintPage
Print a specific page from this publication.

PrintImageFileWH
Print an image file (BMP/PCX/GIF/etc.) using a specific output size. This Action allows you to precisely control the size of the printed image regardless of the resolution of the destination printer.


Also, if there is a Windows Program that can do this better, you can use the Run command (assuming this other program can accept file names in its command line ... or can be made to fetch file names from a specific text file)
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: "Hot Folder" Printing Question

Postby Dan Silverman » Sun Dec 28, 2014 10:25 pm

Thank you, Gaev. I appreciate the very detailed reply and it does help. I have to admit that it has been a long time since I've worked with NeoBook. I will definitely have to play with it again for a bit so that I can follow your logic. I am primarily an artist who is looking for a solution to a problem. Most of what I see available for purchase or free for what I am looking to do is either too complex (does way more than I need it to), too expensive, or is missing something fundamental that I need. I've had success with NeoBook in the past and so I wondered if I could create my own solution. It appears that I just might be able to at that.

Now, I would like to explain what I am trying to do a bit more to see if what you have outlined would still work.

My business partner and I do celebrity photography at sci-fi/fantasy, comic, Anime, and horror conventions. At such a convention, we will be moving a lot of people through the line to get their photo with the celebrity (sometimes upwards of 300+/hour). We photograph against a green screen, edit out the screen, and place the subjects in a nice background. The photographer's camera is tethered to the computer and as he takes a photo it is dumped into a folder. I open the image in a piece of software I already own to quickly remove the green screen. The background and overlay (our logo) is already added via the software. All I am really doing is spot checking the photo and then saving it. When I save it, I want to save the completed image to a folder that is being monitored by an app that is ready to grab it and print it. This means that every few seconds a new photo is being saved to the folder.

Now, I actually do not need the printed images to be moved, though it would be nice. I just need to make sure that any new image added to the 'hot folder' is found by the app and sent to the printer.

My question is, given the speed at which we are working, would the app created in NeoBook be able to keep up? After all, according to what you said, NeoBook would be using a Timer to read and then write a file, comparing the file to what's in the folder. I take it this is all done in milliseconds? Or would it take longer?

A thought just occurred to me (and that can be dangerous). I had stated that I need the app to be able to monitor separate folders and do separate actions for each folder (i.e. Folder1 is associated with Printer1, Folder2 with Printer2, etc.). However, would it be possible to send each new image added to the folder to a different printer? In other words, if there are two printers connected to one PC, could the app be told to send Image1 to Printer1, Image2 to Printer2, Image3 to Printer1, etc.? And could this be expanded to more than two printers?

Ultimately, what I want to create is a single server that one, two, or three artists can remotely send images to (them and the server all being onsite), dumping all images in one folder (if possible) and having the app start serving out the images to a number of printers. This way there is no real lag time in printing. Images are served to Printer1, then Printer2, then Printer3, etc.

Of course, this also means that I would need to create a way to set up the app to know which printers to use and which folder(s) to monitor.
Dan Silverman
 
Posts: 18
Joined: Thu Apr 21, 2005 8:34 am

Re: "Hot Folder" Printing Question

Postby Gaev » Mon Dec 29, 2014 7:58 am

Dan Silverman:

Thank you for the contextual information. Very helpful.

NeoBook should not have a problem handling an image every 12 seconds (5 per minute, 300 per hour).

The key issue is how one prints an image file (abc.png or xyz.jpg ?) ... especially without any human intervention ... even more importantly, directing it to a different printer on a rotating basis (although the logic for determining the next printer to be deployed is quite straight forward).

My experience with printing is limited (personally, I print about 20 pages a year) ... so if you can point to some existing program that you guys use currently, one can investigate if it can accept parameters (file names, printer names).

As well, you can do a simple test to see if the NeoBook commands related to printing do an adequate job ... if they do, then such script commands can be incorporated into the same NeoBook program.

You might also be able to load a page (containing the image file) in the WebBrowser tool ... and use BrowserPrint.

By the way, what are the characteristics of the printed images ? ... width, height, pixel density, paper size etc. ... and what program do you guys currently use to print an image file on your disk ?
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: "Hot Folder" Printing Question

Postby dpayer » Mon Dec 29, 2014 10:55 am

I started on an app a couple years ago that would pull all PDF files from a particular folder and then print them. I did this because I had a very nice laser printer that was made obsolete when Windows 7 (64 bit windows) came out and there were no drivers for the printers. My goal was to "print" pdfs from existing apps and place the resultant file in a particular folder. I prototyped it and got the basics to work but never finished it all off. It uses the PDF plugin from Neosoft

As Gaev mentioned, you can scan a folder based on a timer and act on the resultant list.

My PDF Printer project:
Image
Here is the pub file. It has some rough edges but useful subroutines you could employ if you find helpful. It may show a couple errors when starting as you need to configure (via setup button) a folder with PDFs in it. It then moves the printed PDFs to a subfolder. It can operate in automatic or manual modes.

Here is the Neobook Pub file

Here is a compiled executable file

Good luck with your project. (some day I may polish this one off and make it available in a fully useful form).
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: "Hot Folder" Printing Question

Postby Neosoft Support » Mon Dec 29, 2014 12:34 pm

David Esperalta has a plug-in that lets you monitor folders for changes such as files being added or removed, which sounds like what you're looking for. The plug-in called npNots can be found below:

http://neoplugins.com/?plugin/npnots
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: "Hot Folder" Printing Question

Postby Dan Silverman » Mon Dec 29, 2014 2:30 pm

Gaev wrote:Dan Silverman:

Thank you for the contextual information. Very helpful.

NeoBook should not have a problem handling an image every 12 seconds (5 per minute, 300 per hour).


Thanks. I figured that would not be a problem, but it never hurts to ask. :)

Gaev wrote:The key issue is how one prints an image file (abc.png or xyz.jpg ?) ... especially without any human intervention ... even more importantly, directing it to a different printer on a rotating basis (although the logic for determining the next printer to be deployed is quite straight forward).


We'll just be printing JPG files. More information below ...

I have yet to look into how to direct to a different printer on a rotating basis. But I definitely want to do that. At larger shows we can have six or more printers going to keep up with the prints (people don't want to wait long for their photos). And while I won't necessarily be using only one computer, I would like to make the app flexible enough that the end-user could add the printers they want to use, etc.

Gaev wrote:My experience with printing is limited (personally, I print about 20 pages a year) ... so if you can point to some existing program that you guys use currently, one can investigate if it can accept parameters (file names, printer names).


We are not currently using a program for this, though I have been scouring the web looking for something that is both affordable and can do what we need. As stated previously, most of the software out there is either quite expensive (for me) or does way more than we need it to (thus making it more complex than it needs to be for something I just want to run in the background).

One program I found that was just about perfect is this one:

http://toolmedias.com/autolivepp.html

The UI is very simple. You add a "Hot Folder" (watched or monitored folder), you select a printer or printers, and you turn it on or off ("on" means it starts to monitor the folder). If you then drop an image into the folder, it sends it to the first printer. The second image added goes to the second printer. Etc.

Gaev wrote:As well, you can do a simple test to see if the NeoBook commands related to printing do an adequate job ... if they do, then such script commands can be incorporated into the same NeoBook program.

You might also be able to load a page (containing the image file) in the WebBrowser tool ... and use BrowserPrint.


Thanks for the suggestion. However, I don't believe it needs to be that complex. As long as the printer properties are set up beforehand (set as defaults) then all that would be needed would be to send the image off to the printer spool to be printed. The printer would take care of the rest. So all I would need my app to do is watch a folder, send new images to the printer, and allow the end-user to select the folder to watch and the printer or printers to use.

Gaev wrote:By the way, what are the characteristics of the printed images ? ... width, height, pixel density, paper size etc. ... and what program do you guys currently use to print an image file on your disk ?


The characteristics of the image are as follows:

2400x3000 pixels at 300 dpi. This is a standard 8x10 print.

Normally we print from Photoshop, but it is slow and this is only good for smaller conventions.
Dan Silverman
 
Posts: 18
Joined: Thu Apr 21, 2005 8:34 am

Re: "Hot Folder" Printing Question

Postby Dan Silverman » Mon Dec 29, 2014 2:33 pm

dpayer: Thank you so much for allowing me to peek into your project! I am sure this will help. I am no programmer and it's been years since I've used NeoBook (I used to make digital magazines to teach people about 3D game creation back in the day). But I know that NeoBook is pretty flexible and so I am willing to brave the task if it means I can create the app that I need. So, thanks again for your help. I will certainly download and take a look at how you created your app.
Dan Silverman
 
Posts: 18
Joined: Thu Apr 21, 2005 8:34 am

Re: "Hot Folder" Printing Question

Postby Dan Silverman » Mon Dec 29, 2014 2:34 pm

Neosoft Support wrote:David Esperalta has a plug-in that lets you monitor folders for changes such as files being added or removed, which sounds like what you're looking for. The plug-in called npNots can be found below:

http://neoplugins.com/?plugin/npnots


Thank you. I am looking into that plugin to see if I actually need it. If I can do this with a Timer, as indicated above, then I may not need the plugin. However, if the plugin would make it better, then I may go in that directions.

Thanks again!
Dan Silverman
 
Posts: 18
Joined: Thu Apr 21, 2005 8:34 am

Re: "Hot Folder" Printing Question

Postby Dan Silverman » Mon Dec 29, 2014 2:38 pm

And here's another questions:

Photos are printed either Portrait (taller than wide) or Landscape (wider than tall). Most of the time you have to go into your printer settings and tell it which way to print (portrait or landscape). Is there a way for a NeoBook app to recognize the orientation of an image (taller than wide vs. wider than tall) and auto-rotate it so that it would not be necessary for me to have to change the printer settings? If they all printed out portrait (taller than wide) then that's fine. Once printed, it doesn't matter. The photo can easily be rotated. :P
Dan Silverman
 
Posts: 18
Joined: Thu Apr 21, 2005 8:34 am

Re: "Hot Folder" Printing Question

Postby dec » Mon Dec 29, 2014 3:10 pm

Hello,

Neosoft Support wrote:David Esperalta has a plug-in that lets you monitor folders for changes such as files being added or removed, which sounds like what you're looking for.


Thanks Dave. I also want to talk of my npNots plugin here. I don't know if the npSetDefaultPrinter action of my npUtil plugin can help here or what. Anyway maybe this forum thread can help in some way Dan.
.
Enhance your NeoBook applications!
.
57 plugins, 1113 actions and 230 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: "Hot Folder" Printing Question

Postby Dan Silverman » Mon Dec 29, 2014 3:57 pm

dpayer wrote:Here is the pub file. It has some rough edges but useful subroutines you could employ if you find helpful. It may show a couple errors when starting as you need to configure (via setup button) a folder with PDFs in it. It then moves the printed PDFs to a subfolder. It can operate in automatic or manual modes.

Here is the Neobook Pub file

Here is a compiled executable file

Good luck with your project. (some day I may polish this one off and make it available in a fully useful form).


BTW - The link to your EXE leads to the infamous 404 page not found error. :)
Dan Silverman
 
Posts: 18
Joined: Thu Apr 21, 2005 8:34 am

Re: "Hot Folder" Printing Question

Postby Gaev » Mon Dec 29, 2014 4:58 pm

Dan Silverman:

One program I found that was just about perfect is this one:
http://toolmedias.com/autolivepp.html

Looks like it can do everything you want.

You can test if it works as advertised (there is a 7 day trial period) ... just drop files into the specified folder (using WIndows Explorer).

If it does, it can work very well in tandem with your NeoBook publication. All you need to do is copy the file (from the folder that the Timer tool searches) into the folder that this program searches.

And the same NeoBook script can copy into a rotating set of folders ... just use variables like ...

[BaseDestinationFolder] e.g. "c:\folderForPrinter"
[MaxDestinationFolder] e.g. "5"
[NextDestinationFolder] ... starts at 1 ... the event trigger in each of the Timer objects would copy the file to a folder made up of "[BaseDestinationFolder][NextDestinationFolder]\" ... then ...

- if [NextDestinationFolder] = [MaxDestinationFolder], then reset [NextDestinationFolder] to 1
- else, add one to [NextDestinationFolder]
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: "Hot Folder" Printing Question

Postby Dan Silverman » Mon Dec 29, 2014 5:04 pm

Gaev wrote:Dan Silverman:

One program I found that was just about perfect is this one:
http://toolmedias.com/autolivepp.html

Looks like it can do everything you want.

You can test if it works as advertised (there is a 7 day trial period) ... just drop files into the specified folder (using WIndows Explorer).

If it does, it can work very well in tandem with your NeoBook publication. All you need to do is copy the file (from the folder that the Timer tool searches) into the folder that this program searches.

And the same NeoBook script can copy into a rotating set of folders ... just use variables like ...

[BaseDestinationFolder] e.g. "c:\folderForPrinter"
[MaxDestinationFolder] e.g. "5"
[NextDestinationFolder] ... starts at 1 ... the event trigger in each of the Timer objects would copy the file to a folder made up of "[BaseDestinationFolder][NextDestinationFolder]\" ... then ...

- if [NextDestinationFolder] = [MaxDestinationFolder], then reset [NextDestinationFolder] to 1
- else, add one to [NextDestinationFolder]


I think you may be misunderstanding me. I have completely tested that program and it does work. However, they want almost $300 for it (though it is on special for just under $200 right now). I would rather build the app, if I can, in NeoBook than spend that much money on a small application. And, by building it myself, I have the ability to customize it for any of my photo printing needs now and in the future.

Frankly, if I had purchased that program I would not need to do anything in NeoBook at all. What I am trying to do is emulate that program by building something like it in NeoBook.
Dan Silverman
 
Posts: 18
Joined: Thu Apr 21, 2005 8:34 am

Re: "Hot Folder" Printing Question

Postby dpayer » Tue Dec 30, 2014 12:20 pm

Dan Silverman wrote:BTW - The link to your EXE leads to the infamous 404 page not found error. :)


Opps. Capitalization error on the server. Try again now.

Also, I see I used a plugin that you will need to get and install

Code: Select all
RACGetDefaultPrinter "[defaultprinter]"
RACGetPrinters "[printerlist]"


RACPrinter - http://www.paginasprodigy.com.mx/avalosro/
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Next

Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron