i am working with exam app that give the result and after getting the result it will be printed automatically using the default printer.
i try with JavaScript code
but it show the print window also it show in the file the link and page title which it should not be appear in the result paper.
i saw some PDF plugins but again i didn't see any way to print that file automatically so any suggestion for a code or any tutorial i messed while searching or package
@bobbybouwmann hmmm i try this javascript the issue its show link in footer + title and date in the header of the page which i dont need and it will make some issue.
You can print to a network printer or a printer with a fqdn using PHP, but it looks tircky. Why not use a pdf library like DOMPDF? https://github.com/barryvdh/laravel-dompdf
I don't think it's possible (I could be wrong) to automatically print to a user's default printer. And, if an app did that to me wihout giving me an option to save/download, I think I'd be a little irritated. Open the PDF in a new tab if you need to..
Or am I just not understanding your requirements? Perhpas some more details, and example or code could help us provide a more fully formed response.
@lindstrom yes now iam looking into dompdf and also snappy to choose which one is easier to implement and use \
the requirement
after the student will finish the test he need to click a button to print his result or after click finish exam the result will be printed
if its saved as pdf then print its ok but it should be without user interrupt now iam thinking to do excut code for python and let python print the file after its generated from dompdf or snappy
the other thing is the result it should be like template ready and only pass the result and name of student then it should be saved as pdf and printed to the networked printer
That's exactly what you can do with DOMPDF. You give it a template and an array to populate the template. It creates the PDF which you can either have open automatically when the user finishes or have them click a download link. How you actuate it is up to you. I suppose you could get fancier if this happens on your network and it's your printer, but it seems unnecessarily complicated to go that route.
Spell out the steps the user needs to take upon exam completion and let them do as you instruct would seem to be a pretty decent half measure.
@lindstrom that will be great thanks, i will see what to do, its ok regarding the printing as the app will work local only with 6 to 11 people at one time so this is ok normally ^^
anyway i will try to work with dompdf and see what to do regarding the printing
I have been facing an error regarding the printer that I am using, the unknow error states that epson printer not printing black, I have tried to counter the issue by clearing the cartridge, however, no proper solution is found, I would appreciate if any proper solution regarding the issue ca b