Forum Moderators: coopster
I can see how to create one very large page with suitable page-breaks for each indidual invoice, but have never done anything like that for a large number of pages - so don't know what and when you run into limitations.
Or is there a more appropriate method whereby you create just one page and cycle the process - but if so, how do you initiate the automatic printer initiation? Can that be done successfuly with some javascript?
I'm happy to assume(require) client machines will have a good level of memory - but in such a process, what issues are you likely to run into? Is page timeout going to occur, etc.
Anyone had experiece with this process?
Grateful for any assistance as always.
there could be two ways,
1 - make a large page of 500 invoices, not recommended
2 - use a mysql database or xml repository to store your invoices and then run a loop over invoice to create one page for each invoice
then you can use a function like
echo '<A href="javascript:print()">PRINT THIS PAGE!</A>';
you can also make a javascript function for this in header tags and then call it within your loop after displaying your invoice on the page so that it will be done automatically and you won't need to press this PRINT link yourself.
I'd be very grateful for more comment and advice.
Incidently, how large could I make a html page? If say it was a prudent and workable solution to break the job up into 'print batches' of, say, 50 or so invoices at a time, would that be a good solution?
this need to be done step-by-step
your first assignment is to make sure if print() works in a loop
1 - put it in a function say
function printPage() {
print();
}
2 - then run a loop of 3 runs.
3 - make sure printer is connected
in each run call this function.
if you dont want to waste few pages then keep your page blank white so that your pages will be printed out white :)
see if it works and send three jobs to the printer.
if this step fails according to your research that print wont work automatically then you cannot go further with this, you would need to find another way to make automatic print() calls.
so first try this.
You might consider creating all the 500 invoices in one PDF file, and print in one print command. That seems easier.