If the printer takes the paper long-edge-first (lasers and inkjets
usually take it short-edge first, but roll-fed large-formats or label
printers also take long-edge-first) the cropping of the page image for
crop-to-fit (print-scaling=none) and fill (print-scaling=fill) by the
pdftopdf() filter function did not work correctly. This is fixed now.
Issue #454
(manually backported from commit
70e0f47082550ae212f6b2741a447cbae17a857d)
double final_w,final_h; //Width and height of cropped image.
Rotation pageRot = getRotate(page);
- if(pageRot==ROT_0||pageRot==ROT_180)
+ if (((pageRot == ROT_0 || pageRot == ROT_180) && pageWidth <= pageHeight) ||
+ ((pageRot == ROT_90 || pageRot == ROT_270) && pageWidth > pageHeight))
{
std::swap(pageHeight,pageWidth);
}