Version: 0.7.80 (using 4.1.72 (KDE 4.1.72 (KDE 4.2 >= 20081104)) "release 4.2", KDE:KDE4:UNSTABLE:Desktop / openSUSE_11.0) Compiler: gcc OS: Linux (x86_64) release 2.6.25.16-0.1-default the print output is not scaled to fit on the output page (A4) it looks like it is scaled to 200% about - so half of the information is missing
I don't see this with my samples. Do you see this with all TIFF files? Can you attach an example that shows the problem? If not, can you tell us what application produced the files? What does libtiff's "tiffinfo" utility show for the file.
Created attachment 28382 [details] tiffinfo output I can send you the file privately
Ah, missed that this is _print_, not view. I do see that with my samples (even with just print preview). Looks like we need to scale the image to the QPrinter printable area.
Hmm, tried to fix this (with several varieties of --- /home/bradh/devel/kde-src/kdegraphics/okular/generators/tiff/generator_tiff.cpp (revision 881437) +++ /home/bradh/devel/kde-src/kdegraphics/okular/generators/tiff/generator_tiff.cpp (working copy) @@ -433,7 +433,9 @@ if ( i != 0 ) printer.newPage(); - p.drawImage( 0, 0, image ); + QSize targetSize = printer.pageRect().size(); + + p.drawImage( 0, 0, image.scaled( targetSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) ); } return true; It now fits on the page, and the example that Ferdinand provided looks fine. However I'm not sure it is always going to be right - perhaps will usually look OK if it really came from a printed page, but maybe need to deal with the variable X and Y resolution in some smarter way. Also, I'm not sure if the image should be drawn at pageRect().topLeft() or at (0,0). Pino: any thoughts?
> Pino: any thoughts? Yep: I would also do a check to not scale over the 100% size, ie print the image at its original size reducing it if it does not fit into the page size. That would be enough for a base case, I'd say. What do you think? Also, maybe we would need something to specify the zoom level (ie fit width/page/level)... and maybe also something to specify horizontal and/or vertical alignment within a page... (in short, we'd need kdeprint... :-(.)
SVN commit 890775 by bhards: Implement scale-down for images that would not otherwise fit on the selected printed page format. BUG:174447 M +10 -1 generator_tiff.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=890775
SVN commit 890789 by pino: Backport of SVN commit 890775 by bhards: Implement scale-down for images that would not otherwise fit on the selected printed page format. CCBUG:174447 M +10 -1 generator_tiff.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=890789