Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by kadin
at 2024-08-13 18:23:40
Point:500 Replies:9 POST_ID:828744USER_ID:11654
Topic:
PHP Scripting Language;;Scripting Languages
Can I automate the process of using my printer? Thanks.
1. I have PHP, MYSQL and Apache server set up on a windows machine.
2. Pull data out of database and echo to web page displayed by Firefox.
3. PHP accesses Firefox command to File > Print... and prints this page.
All of this is automated using cron job or cURL
1. I have PHP, MYSQL and Apache server set up on a windows machine.
2. Pull data out of database and echo to web page displayed by Firefox.
3. PHP accesses Firefox command to File > Print... and prints this page.
All of this is automated using cron job or cURL
Author: kadin replied at 2024-08-13 18:50:29
I am trying to visualize what is possible for me to program. It looks like I will design a semi automated system that can do everything but click print.
Expert: duncanb7 replied at 2024-08-13 18:43:53
Thanks for your pt,
But what is your final solution for sharing
But what is your final solution for sharing
Can php access the print command in a web browser to print the web page on paper?
Expert: duncanb7 replied at 2024-08-13 18:42:07
you are correct
So author need to clarify
whether the printing is for himself at command line that is okay
OR he want its users do some printing on browser ?
So author need to clarify
whether the printing is for himself at command line that is okay
OR he want its users do some printing on browser ?
Author: kadin replied at 2024-08-13 18:41:00
Thank you both for your help.
Accepted Solution
Expert: Dave Baldwin replied at 2024-08-13 18:37:09
400 points EXCELLENT
No, he can't do that thru the browser. He could print on the PHP command line but there is no way that he can force the browser to print something. And remember that when the page shows in the browser, PHP has already stopped running for that page.
Expert: duncanb7 replied at 2024-08-13 18:33:51
I have PHP, MYSQL and Apache server set up on a windows machine.
But author said he got apache server on his window machine , and he might be using
apache Xampp server as window server so it might be okay
Expert: Dave Baldwin replied at 2024-08-13 18:30:27
@duncanb7, that command will only work on the server where PHP runs. It can not be used to print on the 'users' computer thru the browser.
Expert: Dave Baldwin replied at 2024-08-13 18:29:17
No, PHP only runs on the server. It can be used to send a page to the browser but then it's done. And nothing in the browser can print a page without the user taking action. You can't automatically print the page.
Assisted Solution
Expert: duncanb7 replied at 2024-08-13 18:28:31
100 points EXCELLENT
you can use php command to do that as follow link
http://www.php.net/manual/en/function.printer-write.php
http://www.php.net/manual/en/function.printer-write.php