For some odd reasons the margins get cropped off when printing to thinlocal from wine. This was tested with the application Foxit Reader and a test PDF that has elements outside the normal A4 margins. Things work fine when printing the same PDF from Evince (i.e. without wine), as well as when printing directly to the printer from wine. In those cases we can print as close to the paper edge as the printer will let us. So it is the specific combination of wine and thinlocal that gets screwed up. nearest has not been tested yet.
I can see the issue appearing already in the first step, i.e. in the postscript file sent from Wine to CUPS. For a thinlocal print I get a document that's 197x271 mm. For a direct print the document is 202x289. These dimensions match what's given in each printer's PPD under "ImageableArea". Given that we are not a real printer driver, perhaps we should just list the entire page as available?
A quick test with this change seems to solve the issue: > *ImageableArea A4/A4: "0 0 595 842"
Also note that this seems to be an incorrect behaviour from Foxit or Wine. ImageableArea is the minimum guaranteed area to be printable. It might be possible to print outside of this, just not guaranteed. So applications should only use this as a hint, not a hard limit.
Created attachment 917 [details] pdf to measure margins
Tested printing from FoxitReader in Wine via thinlocal by using the pdf from comment #6. (In reply to comment #6) > Created an attachment (id=917) [details] > pdf to measure margins Before fix the margins was (in mm): Top: 13 Bottom: 13 Left: 6.5 Right: 6.5 After fix: Top: 4.5 Bottom: 4.5 Left: 4.5 Right: 4.5
After the fix, the margins are still larger than the actual printer margins. That means that there is a bug in Wine which uses "hard limits" for the imageable area so the desired margins cannot be achieved from Wine even with our fix. However, when testing to see if this fix didn't break anything I found out that if you select "Fit to printable area" the image got cropped anyway. This is because it will try to fit the image in the printable area, but the printable area is set to the entire paper dimension. Since our fix breaks "Fit to printable area". We cannot implement it, because it creates another bug so we won't look into it any further. It is up to Wine to fix their margin limits.