Skip to content

Commit

Permalink
cfFilterPDFToPDF(): Initialize output page dimensions
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
tillkamppeter committed Dec 5, 2022
1 parent 55c74cf commit 52d26b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## CHANGES IN V2.0b2 (TBA)

- cfFilterPDFToPDF(): 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).

- cfFilterGhostscript(): Never supply "-dDEVICEWIDTHPOINTS=0
-dDEVICEHEIGHTPOINTS=0", if no page size got requested with the job
(page dimensions are zero in raster header) skip these arguments so
Expand Down
3 changes: 3 additions & 0 deletions cupsfilters/pdftopdf/pdftopdf.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,9 @@ cfFilterPDFToPDF(int inputfd, // I - File descriptor input stream
param.title = data->job_title;
param.num_copies = data->copies;
param.copies_to_be_logged = data->copies;
param.page.width = param.page.height = 0;
param.page.left = param.page.bottom = -1;
param.page.right = param.page.top = -1;

// TODO?! sanity checks

Expand Down

0 comments on commit 52d26b8

Please sign in to comment.