How to specify the Print Width & Height for JPG & PNG image formats in PHP
Product WebClientPrint for PHP
WebClientPrint Processor (WCPP) is the client utility part of WebClientPrint for PHP solution. This utility can print image files in JPG/JPEG & PNG formats without requiring nor using any additional software!
WebClientPrint Processor (v3.0+) supports a new feature which allows you to specify the X, Y position, the Print Width & Height as well as the Print Orientation values right into the File Name of the JPG/PNG image you want to print by using the following parameters:
||It's the X print position (left to right) in INCH unit
||It's the Y print position (top to bottom) in INCH unit
||It's the Print Width in INCH unit
||It's the Print Height in INCH unit
||It's the Print Orientation, 'P' for Postrait and 'L' for Landscape
So supposing you want to print a jpg image file which name on disk is MyPicture.jpg and you want to print it at X,Y 0.1in, in a 4.25in x 3.50in size then the PrintFile instantiation should be written as follows:
$myPrintFile = new PrintFile('images/MyPicture.jpg', 'MyPicture-PX=0.1-PY=0.1-PW=4.25-PH=3.50-PO=P.jpg', null);
By using JPG/PNG images at high dpi resolution (300 or above) you could print from text to pictures at high quality output. It's great alternative to other document formats like PDF or Word doc which requires Adobe Reader and MS Word respectively installed at the client machine. Of course, in these cases you should convert pdf or doc to a set of high quality images by using some another tools.