Bug 7437 - Cropped margins with thinlocal in wine
Summary: Cropped margins with thinlocal in wine
Status: CLOSED INVALID
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Printing (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.11.0
Assignee: Alex Tanskanen
URL:
Keywords:
Depends on:
Blocks: 7441
  Show dependency treegraph
 
Reported: 2019-11-18 12:13 CET by Pierre Ossman
Modified: 2019-11-25 10:49 CET (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments
pdf to measure margins (9.71 KB, application/pdf)
2019-11-21 10:20 CET, Alex Tanskanen
Details

Description Pierre Ossman cendio 2019-11-18 12:13:44 CET
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.
Comment 2 Pierre Ossman cendio 2019-11-18 13:42:48 CET
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?
Comment 3 Pierre Ossman cendio 2019-11-18 14:10:59 CET
A quick test with this change seems to solve the issue:

> *ImageableArea A4/A4:                  "0 0 595 842"
Comment 4 Pierre Ossman cendio 2019-11-18 14:18:46 CET
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.
Comment 6 Alex Tanskanen cendio 2019-11-21 10:20:06 CET
Created attachment 917 [details]
pdf to measure margins
Comment 7 Alex Tanskanen cendio 2019-11-21 11:20:29 CET
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
Comment 8 Alex Tanskanen cendio 2019-11-21 12:42:45 CET
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.

Note You need to log in before you can comment on or make changes to this bug.