Related Content
Generating Histogram Colour Analysis Graphs From Images In PHP
If you've ever looked at the settings in a digital camera, or have experience with image processing programs like GIMP, then you may have seen a colour histogram. This is a simple graph that shows the amount of different shades of colour are present in the image.
PHP:CSI - To Switch, Or Not To Switch?
I was writing unit tests for a API mapping function recently and came across this interesting issue. The code I was writing tests for was in a legacy codebase that I was making changes to, and it made sense to have some unit tests in there before I started work to ensure everything worked before and after.
Drupal 9: Generating Header Images For Pages Of Content Using PHP
Embedding image within pages of content helps both within the design of the page and when shared on social media. If you set up meta tags to point at a particular image then that image will appear when the page is shared on social media. This makes your page stand out more.
Using PSR-4 With Composer
The PHP Standards Recommendations (called PSR) are a set of standards that aim to make certain aspects of working with PHP easier.
Generating A PDF From A Web Page Using PHP And Chrome
Generating a PDF document from a web page through PHP can be problematic. It's often something that seems quite simple, but actually generating the document can be difficult and time consuming.
PHP:CSI - Date Is Less Than One Month Ago
Working with logic surrounding dates can sometimes be difficult and it's fairly common to come across really subtle date and time based bugs.
I was recently shown a bug in a PHP application that looks like it should be working at face value, but doesn't actually produce the correct result.
Comments
Submitted by Bart on Sat, 10/30/2010 - 18:55
PermalinkSubmitted by me 2 on Mon, 05/14/2012 - 06:59
PermalinkSubmitted by me 2 on Mon, 05/14/2012 - 07:01
PermalinkSubmitted by Saint-Cyr on Sat, 07/18/2015 - 08:46
PermalinkSubmitted by Lawrence on Thu, 10/08/2015 - 14:51
PermalinkSubmitted by philipnorton42 on Thu, 10/08/2015 - 15:03
PermalinkSubmitted by lawrence on Thu, 10/08/2015 - 16:39
PermalinkSubmitted by philipnorton42 on Thu, 10/08/2015 - 17:19
PermalinkSubmitted by Tom on Thu, 11/19/2015 - 12:25
PermalinkSubmitted by Amir on Mon, 06/20/2016 - 21:07
Permalinkshell_exec('lpr file.txt');
Might be worth a shot?Submitted by philipnorton42 on Tue, 06/21/2016 - 10:51
PermalinkSubmitted by ken chandara on Tue, 07/19/2016 - 04:50
PermalinkSubmitted by Philip Okugbe on Tue, 08/23/2016 - 19:53
PermalinkSubmitted by Pradeep Chavan on Sat, 04/01/2017 - 14:44
PermalinkPrinting directly From PHP make is possible to let the user print a document on his own printer. But PHP is completely server-side. So this would mean using the printer-functions, you can only print on devices connecting to the server.
Submitted by Jhonmilton on Fri, 08/10/2018 - 11:33
PermalinkAre you really serious?
Your code is nice and only meant for the developer.
How do you expect me to know the names of the all the printers for all the clients that use my app?
If there was another way, I could eh.., have my clients input or select their printer from the list of printers they have on their machines, then pass that value to the php.ini file, that would be fine.
Meanwhile, even with that, writing a code to draw-text and draw lines for every bit of row and column to be printed, is far-too-cumbersome.
Where does the CSS styling come in?
Thank you
Submitted by Anonymous on Sat, 12/26/2020 - 10:41
Permalink> Are you really serious?
Well, yes. I mean I used it for a while back in 2009. Haven't really had the need to use it since then though. I think the package has been made largely redundant for a good while now, not even sure it will work with PHP8. Since this is Windows only I haven't had any way of running this code for at least 8 years.
> Your code is nice and only meant for the developer.
Yes. It is only meant for the developer. Sorry if this isn't clear.
> How do you expect me to know the names of the all the printers for all the clients that use my app?
I think you might be mistaken. Since PHP is a server side language you should absolutely know what printer you are going to print to as it will be connected to your server.
> If there was another way, I could eh.., have my clients input or select their printer from the list of printers they have on their machines, then pass that value to the php.ini file, that would be fine.
You could allow your users to select from a list of printers, but the printer would need to be available from the server you are running your PHP on. If the printer is connected to the server via a network then you could potentially use printer_open() with the name of the printer you are trying to open as the paramter.
> Meanwhile, even with that, writing a code to draw-text and draw lines for every bit of row and column to be printed, is far-too-cumbersome.
True, but if you are printing something simple like a shopping receipt then this would be ideal.
> Where does the CSS styling come in?
Well, it doesn't as CSS is never interpreted by PHP to render the printer output. It sounds like you are trying to print from a browser, in which case this code would never be run as it would be the browser doing the printing.
Submitted by philipnorton42 on Sat, 12/26/2020 - 13:48
PermalinkAdd new comment