pstops re-applies the PPD's default output order after pdftopdf, inverting explicit `outputorder` on face-up PostScript queues
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
The filter chain drops OutputOrder in ppd/pdftops.c (ppdFilterPDFToPS, around L77–L91 and L595), and pstops then falls back to the PPD default in ppd/imagetops-pstops.c (around L4257–L4275, applied near L4385). Start by reproducing with cupsfilter -p ps.ppd -m application/vnd.cups-postscript -o outputorder=reverse test.pdf and the sample face-up OutputBin PPD. Done means explicit normal/reverse survives pstops while the PPD default applies only when the job omits outputorder, coordinated with libcupsfilters#366.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This issue was found by Claude while preparing https://github.com/OpenPrinting/libcupsfilters/pull/366.
Describe the bug
On a PostScript PPD queue whose default output bin has *PageStackOrder ...: Reverse (or that has *DefaultOutputOrder: Reverse), an explicit output order in the job comes out inverted. pdftopdf applies the requested order, and then pstops reverses the pages again because of the PPD default.
| Job option | Printed order (3-page document) |
|---|---|
| none | 3, 2, 1 (correct) |
outputorder=reverse |
1, 2, 3 |
outputorder=normal |
3, 2, 1 |
To Reproduce
-
Take a generic PostScript PPD, e.g.
/usr/lib/cups/daemon/cups-driverd cat drv:///sample.drv/generic.ppd > ps.ppd, and append a face-up output bin:*OpenUI *OutputBin/Output Tray: PickOne *OrderDependency: 10 AnySetup *OutputBin *DefaultOutputBin: FaceUp *OutputBin FaceUp/Face Up: "" *PageStackOrder FaceUp: Reverse *CloseUI: *OutputBin -
Run a 3-page PDF with numbered pages through the filter chain (pdftopdf, pdftops):
cupsfilter -p ps.ppd -m application/vnd.cups-postscript -o outputorder=reverse test.pdf > out.ps -
See the pages in
out.pscome out as 1, 2, 3. With-o outputorder=normalthey come out as 3, 2, 1.
Running the pdftopdf and pdftops filters by hand with PPD=ps.ppd gives the same result. *DefaultOutputOrder: Reverse instead of the output bin behaves the same way.
Expected behavior
An explicit outputorder=reverse prints the pages in reverse order and outputorder=normal in normal order, as on queues without a reverse default. The PPD's default order should only apply when the job doesn't ask for one.
Screenshots
No screenshots; the relevant log line from cupsfilter with outputorder=reverse shows pstops reversing the already reversed pages:
DEBUG: ppdFilterPSToPS: slow_collate=0, slow_duplex=0, slow_order=1
System Information:
- OS: Arch Linux
- Version: libppd 2.1.1 (libppd master 93ed8499 has the same code)
- Version of CUPS, libcupsfilters, ...: CUPS 2.4.20, cups-filters 2.0.1, libcupsfilters 2.2.1 (git 3bf18925) and master 89e4c33a with OpenPrinting/libcupsfilters#366
Additional context
When pdftopdf has run, ppdFilterPDFToPS() drops OutputOrder from the pstops options (pdftops.c L77–L91, L595). pstops then treats the missing option as "use the PPD default" (imagetops-pstops.c L4257–L4275) and reverses again (L4385).
Suggested fix: pass OutputOrder=Normal to pstops instead of dropping it, as Collate=True is added back (L609–L617). This needs coordinating with OpenPrinting/libcupsfilters#366, which leaves the default order of PostScript PPD queues to pstops because of this bug. A pdftopdf marker like %%PDFTOPDFNumCopies could tell libppd when pdftopdf has applied the order, so mixed versions keep working. Happy to help with either side.
Tested with the generic PPD above, not on a physical face-up PostScript printer.
- Ngôn ngữ chính
- C
- Star
- 6
- Fork
- 38
- Merge trung bình
- 16 giờ 30 phút
- Pull request đã merge (30 ngày)
- 25
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của OpenPrinting/libppd
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
OpenPrinting/libppd#95 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
OpenPrinting/libppd#93 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
OpenPrinting/libppd#90 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
OpenPrinting/libppd#65 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
OpenPrinting/libppd#60 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của OpenPrinting/libppd
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
python-pillow/Pillow#10590 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
CCExtractor/ccextractor#2478 ·
Maintainer thường phản hồi trong vòng 7 ngày
-
增加kmod-nft-queueĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
ESPresense/ESPresense#2680 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
OpenPrinting/cups#1828 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày