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 ronipats
at 2024-03-21 22:01:16
Point:500 Replies:5 POST_ID:828902USER_ID:10
Topic:
PHP Scripting Language;;
Hi all,
i am developing a bill application in php, mysql.
I have designed and developed bill.php form in which, on pressing print button, i want to print the bill to printer.
I have designed onw bill report in using fpdf. so the format of bill is .pdf.
Now each time i press on print button, bill.pdf file is getting previewed and then only i am able to take print out of it.
What i want to do is, i want to print that bill to printer without generating preview, or opening any sort of popup window. Again it should be fast enough.
How can i do that.
Any solution other than fpdf is there, then also it is welcomed.
i am developing a bill application in php, mysql.
I have designed and developed bill.php form in which, on pressing print button, i want to print the bill to printer.
I have designed onw bill report in using fpdf. so the format of bill is .pdf.
Now each time i press on print button, bill.pdf file is getting previewed and then only i am able to take print out of it.
What i want to do is, i want to print that bill to printer without generating preview, or opening any sort of popup window. Again it should be fast enough.
How can i do that.
Any solution other than fpdf is there, then also it is welcomed.
Expert: duncanb7 replied at 2024-06-06 21:43:19
Thanks for your points
Have a nice day
Duncan
Have a nice day
Duncan
Expert: Ray Paseur replied at 2024-03-28 04:40:13
@ronipats: Out of the last 10 questions, you've given only two grades of "A" and this is unheard-of behavior in a community where the default and expected grade is "A." You are required by the community standards to explain any grade that is less than "A" and you have not provided an explanation here, so I am reopening the question to give you a chance to explain yourself.
Since you gave the worst possible grade anyone can give to a colleague at EE, you may want to review the grading guidelines as you formulate your explanation.
http://support.experts-exchange.com/customer/portal/articles/481419
Since you gave the worst possible grade anyone can give to a colleague at EE, you may want to review the grading guidelines as you formulate your explanation.
http://support.experts-exchange.com/customer/portal/articles/481419
Expert: Ray Paseur replied at 2024-03-22 05:03:34
You're on firm ground by using FPDF. There is also TCPDF, but I don't think the choice of PDF generation software matters.
The question seems to evince some confusion about the roles of the client and the server. These are terms of art in modern computer design. More information is available here:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/A_11271-Understanding-Client-Server-Protocols-and-Web-Applications.html
The server can respond to a client request by sending a document, but it cannot initiate an action on the client machine. In other words, if your clients are using the internet to talk to your server, then the clients have to be the ones that tell the browser to print the document. However if you're using a networked printer on Windows, you may be in luck.
Please see http://www.php.net/manual/en/printer.installation.php
It's a windows-only extension that is intended to make a networked printer do things. In other words, it does not work over the internet and support may be spotty or release dependent.
The question seems to evince some confusion about the roles of the client and the server. These are terms of art in modern computer design. More information is available here:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/A_11271-Understanding-Client-Server-Protocols-and-Web-Applications.html
The server can respond to a client request by sending a document, but it cannot initiate an action on the client machine. In other words, if your clients are using the internet to talk to your server, then the clients have to be the ones that tell the browser to print the document. However if you're using a networked printer on Windows, you may be in luck.
Please see http://www.php.net/manual/en/printer.installation.php
It's a windows-only extension that is intended to make a networked printer do things. In other words, it does not work over the internet and support may be spotty or release dependent.
Expert: Dave Baldwin replied at 2024-03-21 23:16:43
I don't believe you can do that. PHP running on the server does not have access to a user's printer (though it might be able to print to a printer connected to the server). Even when you have generated the PDF, you still have to send it to the user. When a user prints a document, it will have to print from a file on their computer.
While most browsers have a way to open a PDF these days, you can not force it to be printed. It is one of the basic security restrictions in all browsers is that you can not force anything to be done on the user's computer. They have to be able to approve anything you want to do on their machine. That includes printing and downloading and uploading files.
While most browsers have a way to open a PDF these days, you can not force it to be printed. It is one of the basic security restrictions in all browsers is that you can not force anything to be done on the user's computer. They have to be able to approve anything you want to do on their machine. That includes printing and downloading and uploading files.
Accepted Solution
Expert: duncanb7 replied at 2024-03-21 22:16:17
500 points AVERAGE
Please read the following php.net link and the following function for
printing PDF on php that is just example code only and not tested, you
can use it for a quick start. And I'm not sure whether it is need to set
PRINTER_MODE option mode to be RAW. You can work around that.
Hope understand your question completely, if not please pt it out
Duncan
http://www.php.net/manual/en/function.printer-open.php
http://www.php.net/manual/en/function.printer-write.php
// Set print mode to RAW and send PDF to printer
printer_set_option($ph, PRINTER_MODE, "RAW");
printing PDF on php that is just example code only and not tested, you
can use it for a quick start. And I'm not sure whether it is need to set
PRINTER_MODE option mode to be RAW. You can work around that.
Hope understand your question completely, if not please pt it out
Duncan
http://www.php.net/manual/en/function.printer-open.php
http://www.php.net/manual/en/function.printer-write.php
// Set print mode to RAW and send PDF to printer
printer_set_option($ph, PRINTER_MODE, "RAW");
function printIssue(){ $your_printer_name = "EPSON LX-300"; $handle=printer_open($your_printer_name);//set the font characteristics here $font_face = "Draft Condensed"; $font_height = 20; $font_width = 6;$font=printer_create_font($font_face,$font_height,$font_width,PRINTER_FW_THIN,false,false,false,0);printer_select_font($handle,$font);printer_write($handle,"My PDF file content below");//here loop through your pdf file and print the line by line or else get the entire content inside the string at once and print$your_pdf_file = "somethng.pdf"; if(!eof($file_handle)) { //do something printer_write($handle,$name); } printer_delete_font($font); printer_close($handle);} 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21: