Skip to content

Commit 52d26b8

Browse files
committed
cfFilterPDFToPDF(): Initialize output page dimensions
Initialize output page dimensions to easily identify if no dimensions were supplied, to fall back to default size Letter. Otherwise we get invalid PDF output if we do not specify the output page dimensions (no printer IPP attributes) but need them (for print-scaling=fit/fill, numper-up, booklet).
1 parent 55c74cf commit 52d26b8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## CHANGES IN V2.0b2 (TBA)
44

5+
- cfFilterPDFToPDF(): Initialize output page dimensions to easily
6+
identify if no dimensions were supplied, to fall back to default
7+
size Letter. Otherwise we get invalid PDF output if we do not
8+
specify the output page dimensions (no printer IPP attributes) but
9+
need them (for print-scaling=fit/fill, numper-up, booklet).
10+
511
- cfFilterGhostscript(): Never supply "-dDEVICEWIDTHPOINTS=0
612
-dDEVICEHEIGHTPOINTS=0", if no page size got requested with the job
713
(page dimensions are zero in raster header) skip these arguments so

cupsfilters/pdftopdf/pdftopdf.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,9 @@ cfFilterPDFToPDF(int inputfd, // I - File descriptor input stream
888888
param.title = data->job_title;
889889
param.num_copies = data->copies;
890890
param.copies_to_be_logged = data->copies;
891+
param.page.width = param.page.height = 0;
892+
param.page.left = param.page.bottom = -1;
893+
param.page.right = param.page.top = -1;
891894

892895
// TODO?! sanity checks
893896

0 commit comments

Comments
 (0)