The autorotate by pdftopdf severe a size judging of paper.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cups-filters (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Release: 12.04
cups-filters: 1.0.18-0ubuntu0.1
When PDF of landscape is printed by "lpr test.pdf", it is printed with portrait.
pdftopdf rotates 90 degrees automatically, when PDF is landscape.
However, a judgment is too severe.
It does not rotate, when PDF is larger than a paper.
There is an error in the size of PDF.
A4 is defined by 595x842 at ppd of CUPS.
It will rotate, if the size of PDF is 842x595.
However, the size of PDF may be 841.89 x 595.276 pts (A4).
In this case, it does not rotate.
I want to rotate if the size difference is less than 1point.
--- P2PPage.cxx.bak 2012-11-18 05:39:25.059384813 +0900
+++ P2PPage.cxx 2012-11-18 05:46:02.086929669 +0900
@@ -585,8 +585,8 @@
double pageHeight = mediaBox.y2 - mediaBox.y1;
if (pageHeight < 0) pageHeight = -pageHeight;
- if ((mediaWidth >= pageWidth && mediaHeight >= pageHeight)
- || (mediaWidth < pageHeight || mediaHeight < pageWidth)) {
+ if (((mediaWidth+1) >= pageWidth && (mediaHeight+1) >= pageHeight)
+ || ((mediaWidth+1) < pageHeight || (mediaHeight+1) < pageWidth)) {
/* the page is inside the media or rotated page is not inside */
return;
}