Created attachment 107387 [details] Resuling postscript from pstops due to incorrect parametrization When specifying custom media dimensions for a printout (on a physical printer), the command sent to CUPS includes the media dimensions. Unfortunately, the values are given in swapped order. According to CUPS manual https://www.cups.org/doc/options.html the correct order of the dimensions is lp -o media=Custom.WIDTHxLENGTHmm filename But the assignment is performed in reverse order, see file "fileprinter.cpp" line 539: case QPrinter::Custom: return QStringLiteral("Custom.%1x%2mm") .arg( printer.heightMM() ) .arg( printer.widthMM() ); Please swap heightMM() and widthMM(). In the current version (and for many years), printouts of A4 portraits (borderless) are being shrinked by pstops to the bottom-right corner of the portrait media. The resulting content height corresponds to the width of the media (due to swapped values). I have attached an example of the resulting shrinked postscript, which is then passed to the CUPS filter of my printer (Brother DCP585CW). Here is the relevant excerpt of /var/log/cups/erros.log in debug mode, including the incorrect dimensions in argv[5]: D [20/Aug/2017:07:42:54 +0200] [Job 477] 2 filters for job: D [20/Aug/2017:07:42:54 +0200] [Job 477] pstops (application/postscript to application/vnd.cups-postscript, cost 66) D [20/Aug/2017:07:42:54 +0200] [Job 477] brlpdwrapperdcp585cw (application/vnd.cups-postscript to printer/Brother_DCP-585CW, cost 0) D [20/Aug/2017:07:42:54 +0200] [Job 477] job-sheets=none,none D [20/Aug/2017:07:42:54 +0200] [Job 477] argv[0]="Brother_DCP-585CW" D [20/Aug/2017:07:42:54 +0200] [Job 477] argv[1]="477" D [20/Aug/2017:07:42:54 +0200] [Job 477] argv[2]="robert" D [20/Aug/2017:07:42:54 +0200] [Job 477] argv[3]="Example.pdf" D [20/Aug/2017:07:42:54 +0200] [Job 477] argv[4]="1" D [20/Aug/2017:07:42:54 +0200] [Job 477] argv[5]="Collate finishings=3 fit-to-page job-billing media=Custom.291x205mm number-up=1 number-up-layout=lrtb outputorder=reverse page-bottom=10 page-left=10 page-right=10 page-top=10 portrait sides=one-sided job-uuid=urn:uuid:7ae72161-74c7-3701-5164-eb4fab1e615f job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1503207774 time-at-processing=1503207774 document-name-supplied=okular_nS1822.ps" D [20/Aug/2017:07:42:54 +0200] [Job 477] argv[6]="/var/spool/cups/d00477-001" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[0]="CUPS_CACHEDIR=/var/cache/cups" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[1]="CUPS_DATADIR=/usr/share/cups" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[2]="CUPS_DOCROOT=/usr/share/cups/doc" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[4]="CUPS_REQUESTROOT=/var/spool/cups" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[5]="CUPS_SERVERBIN=/usr/lib/cups" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[6]="CUPS_SERVERROOT=/etc/cups" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[7]="CUPS_STATEDIR=/run/cups" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[8]="HOME=/var/spool/cups/tmp" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[9]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/bin:/bin:/usr/bin" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[10]="SERVER_ADMIN=root@Blocko" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[11]="SOFTWARE=CUPS/2.2.4" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[12]="TMPDIR=/var/spool/cups/tmp" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[13]="USER=root" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[14]="CUPS_MAX_MESSAGE=2047" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[15]="CUPS_SERVER=/run/cups/cups.sock" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[16]="CUPS_ENCRYPTION=IfRequested" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[17]="IPP_PORT=631" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[18]="CHARSET=utf-8" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[19]="LANG=en.UTF-8" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[20]="PPD=/etc/cups/ppd/Brother_DCP-585CW.ppd" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[21]="RIP_MAX_CACHE=128m" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[22]="CONTENT_TYPE=application/postscript" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[23]="DEVICE_URI=lpd://10.0.0.5/BINARY_P1" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[24]="PRINTER_INFO=Brother DCP-585CW" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[25]="PRINTER_LOCATION=Home" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[26]="PRINTER=Brother_DCP-585CW" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[27]="PRINTER_STATE_REASONS=none" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[28]="CUPS_FILETYPE=document" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[29]="FINAL_CONTENT_TYPE=application/vnd.cups-postscript" D [20/Aug/2017:07:42:54 +0200] [Job 477] envp[30]="AUTH_I****" I [20/Aug/2017:07:42:54 +0200] [Job 477] Started filter /usr/lib/cups/filter/pstops (PID 1911) I [20/Aug/2017:07:42:54 +0200] [Job 477] Started filter /usr/lib/cups/filter/brlpdwrapperdcp585cw (PID 1912) I [20/Aug/2017:07:42:54 +0200] [Job 477] Started backend /usr/lib/cups/backend/lpd (PID 1913) When manually running pstops filter with swapped "media=Custom.205x291mm", the result is as desired. Regards, Robert
This Bug might also be the reason for the issue reported in https://bugs.kde.org/show_bug.cgi?id=383119
Git commit 0919ad87d1826c2c4ad7ac845716f9b8d97d3b03 by Albert Astals Cid. Committed on 20/08/2017 at 22:09. Pushed by aacid into branch 'Applications/17.08'. Fix width and height being switched when printing Custom size M +2 -2 core/fileprinter.cpp https://commits.kde.org/okular/0919ad87d1826c2c4ad7ac845716f9b8d97d3b03
*** Bug 348171 has been marked as a duplicate of this bug. ***
*** Bug 363788 has been marked as a duplicate of this bug. ***
*** Bug 347794 has been marked as a duplicate of this bug. ***