SiriusPhil
asked on
Auto Printing a Cold Fusion Web Page Using A Broadcast Printer on a Print Server
I have an application which needs to print a report to numerous printers. Right now the person who makes the edit, manually pulls up a printable CFM page on their local computer after editing the data. The printable page pulls up the print dialog box using a JavaScript, then the user selects the broadcast printer from their list of printers and prints the page. This broadcast printer is shared network printer in a Print Que Manager application on a different server.
I'm looking for a way to automatically print this cfm page transparently. Is there a way to get the page to print from the CF server using a designated broadcast printer on the CF server or is there a way to do it on the client computer using the clients broadcast printer (which is NOT the default printer on their computer)?
I've seen some similar questions but non that address a non-default printer.
Thanks.
Phil Hayes
I'm looking for a way to automatically print this cfm page transparently. Is there a way to get the page to print from the CF server using a designated broadcast printer on the CF server or is there a way to do it on the client computer using the clients broadcast printer (which is NOT the default printer on their computer)?
I've seen some similar questions but non that address a non-default printer.
Thanks.
Phil Hayes
Hi SiriusPhil,
If your using CF7 or upgrade to CF7 you can turn the webpage into a PDF, from there you can call CFEXECUTE to open acrobat reader and send it to a specific printer.
Regards
Plucka
If your using CF7 or upgrade to CF7 you can turn the webpage into a PDF, from there you can call CFEXECUTE to open acrobat reader and send it to a specific printer.
Regards
Plucka
ASKER
Yes, I am using CFMX7 and can easily write it as a PDF. How would I use CFEXECUTE to send it to a specific printer?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
There are also third party products.
Like Activepdf Spooler, but they just do the same as the above and are no more reliable.
Like Activepdf Spooler, but they just do the same as the above and are no more reliable.
ASKER
Sounds good. I'll let you know how it works. Stay tuned.
Thanks.
Thanks.
ASKER
Ok. For testing purposes, instead of passing arguements, I tried to use CFEXECUTE directly. I tested the bat file by just running it, so I know it works. When I try to execute the bat file using CFEXECUTE, I get:
An exception occurred when invoking an external process.
The cause of this exception was that: java.io.IOException: CreateProcess: E:\websites\fireweb\tasks\ printSK.ba t error=3.
I have CFMX server set to run as me (not as administrator) and I have acrobat and the printer set up under my profile. Any ideas what an error = 3 is? Do I have to use an administrator account? If so, will the machine administrator do, or do I need the overall system administrator account.
Thanks. Almost there.
An exception occurred when invoking an external process.
The cause of this exception was that: java.io.IOException: CreateProcess: E:\websites\fireweb\tasks\
I have CFMX server set to run as me (not as administrator) and I have acrobat and the printer set up under my profile. Any ideas what an error = 3 is? Do I have to use an administrator account? If so, will the machine administrator do, or do I need the overall system administrator account.
Thanks. Almost there.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Make sure both the .bat file and .pdf file are valid for the path where you are pointing.
Also is E a local or network drive?
Regards
Plucka
Also is E a local or network drive?
Regards
Plucka
ASKER
The problem appears to have been with the path. I fixed it. I was able to batch print once, but since then, the CF page with the CFEXECUTE processes but does not print to where it is supposed to. I'm trying to track down the problem.
This is an acrobat or user / permission issue.
Check your processes running as this user, you will probably find an acrobat process, kill this off and try again, if it works once again, then acrobat isn't behaving.
Seen this often, my solution is to
1. Use Acrobat Reader 5
2. Ensure all update / licence acceptance stuff has happened for the running user
3. Try the batch directly if it works, then it's a user / permission problem between coldfusion and acrobat.
Regards
Plucka
Check your processes running as this user, you will probably find an acrobat process, kill this off and try again, if it works once again, then acrobat isn't behaving.
Seen this often, my solution is to
1. Use Acrobat Reader 5
2. Ensure all update / licence acceptance stuff has happened for the running user
3. Try the batch directly if it works, then it's a user / permission problem between coldfusion and acrobat.
Regards
Plucka
HTML printing requires browser-like program. There is undocumented feature in MS IE object that allows printing without a prompt. However, there is no way to select the printer. You have to make your printer the default, or re-write default printer in registry temporarily.
There is also a third-party printing object (client-side and server-side), but it cost in range 150-300$. Search Web for clues. At some moment we were considering using it, but ended with another solution.