note 73404 deleted from function.printer-draw-bmp by sobak
| From: | sobak@php.net | Date: | Thu, 24 Nov 2016 20:31:45 +0000 |
| Subject: | note 73404 deleted from function.printer-draw-bmp by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207579@lists.php.net to get a copy of this message | ||
Note Submitter: codeslinger at compsalot dot com
----
Don't get confused by the example. The X Y offset is Base 0 not 1. The example was trying to
show that you could position the image elsewhere.
Also, the X Y offsets accept a negative value which can be very handy if you want to print just part
of the image. Such as when splitting an image across multiple pages.
Most (all?) printers will shift your output by the amount of the "unprintable" area.
Suppose you want to print an image at exactly X = 0.25, Y = 0.25 inches (from the top left).
On a typical printer with an unprintable area of 0.116 inches, the printer adds that amount as an
offset. So, to compensate you just subtract the offset.
$X = 0.25 - 0.116;
$Y = 0.25 - 0.116;
With the result being that your image will be physically located where you intended.
Keep in mind that the unprintable area can be a different amount for the X and Y, for this example
printer they both just happen to be the same.
Now the catch is that printer_get_option does not provide a way to get the unprintable area size.