Link to home
Start Free TrialLog in
Avatar of Gewgala
GewgalaFlag for United States of America

asked on

Do I have to cache data before sending to a printer

I have been tasked with a large amount of printer work.  When printing large amounts of data (possibly thousands of pages) I need to know concretely what my options are.

So far, my understanding is that all data, regardless of size, needs to be cached and then sent to the printer.  For example, in c#, I have written a custom paginator that is tailored to what my project needs to print.  I have to give that paginator a data source, which then goes and prepares each page until it has iterated through the entire data source.  This means I have to supply the whole data source up front (this is what I mean by caching).  I send the paginator to the printer which actually executes the paging code and does the iterations through the data source.  This approach creates a single print job in the printer's queue.  

Today I was told by superiors that competitor product(s) actually send each page to the printer as they come in from across the network.  They are saying that when a thousand pages are printed, the application receives the first page, sends it to the printer, receives the second page, sends it to the printer, and so on until the very last page.  They told me I need to do it this way.  I have some concerns with this approach.  Namely, that even if things did work this way they are actually creating 1,000 print jobs in the printer's queue/job tray.  If, in the middle of this giant list of jobs (each job being a single page) someone decides to print something else like say an email they received or an invitation to their daughter's birthday party, the email or invitation would be outputted in the middle of the 1,000-job pages (they'd be a mixed mess that someone would have to sort through once all the printing was done).

I would like to get a little insight on best practices involving my scenario and if I correctly understand how printer queues work.  Also, I would like to know if it is possible with c# to send one page at a time to the printer but still maintaining one single print job (regardless of how many pages there are overall) sort of like treating the printer as a stream and "streaming in" each page as it comes in while the one single print job in the print queue/tray remains open.

I want to say right off the bat that this whole thing is stupid and that they are wrong, but before I send off a fiery email I'd like to verify my understanding.

Thank you for your assistance and please let me know if I can be more clear.
Avatar of Gewgala
Gewgala
Flag of United States of America image

ASKER

(side note, I think it's pretty cool that I subbmitted the question at 11/1/11 at 11:11 am!  I didn't plan that at all)
ASKER CERTIFIED SOLUTION
Avatar of DansDadUK
DansDadUK
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
... and your post (in my timezone (GMT)) was recorded at 2011-11-01 18:11.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gewgala

ASKER

Thank you for your help.