From kde-commits Tue Aug 22 06:56:29 2006 From: Stefan Kebekus Date: Tue, 22 Aug 2006 06:56:29 +0000 To: kde-commits Subject: KDE/kdegraphics/kviewshell/plugins/ps Message-Id: <1156229789.927981.17314.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=115622979509963 SVN commit 575818 by kebekus: properly respect bounding boxes for EPS file; port from kvs 0.7 M +6 -14 psRenderer.cpp --- trunk/KDE/kdegraphics/kviewshell/plugins/ps/psRenderer.cpp #575817:575818 @@ -137,31 +137,23 @@ int pageHeight = ps.sizeInPixel(res).height(); int pageWidth = ps.sizeInPixel(res).width(); - if (isThumbnail) - { + if (isThumbnail) { // Because the rendering quality of ghostscript is quite bad at low resolutions, we // render thumbnails two times as big as needed, and then downscale the final image. argus << QString("-r%1").arg(2 * res); // resolution in dpi argus << QString("-g%1x%2").arg(2 * pageWidth).arg(2 * pageHeight); // page size in pixels - } - else - { + } else { argus << QString("-r%1").arg(res); // resolution in dpi argus << QString("-g%1x%2").arg(pageWidth).arg(pageHeight); // page size in pixels } argus << "-dTextAlphaBits=4 -dGraphicsAlphaBits=2"; // Antialiasing - argus << "-c" << "<< /PermitFileReading [ ExtraIncludePath ] /PermitFileWriting [] /PermitFileControl [] >> setuserparams .locksafe"; - if (eps) - { + argus << "-c" << KProcess::quote("<< /PermitFileReading [ ExtraIncludePath ] /PermitFileWriting [] /PermitFileControl [] >> setuserparams .locksafe"); + if (eps) { + argus << "-c" << KProcess::quote("%1 %2 translate").arg(-internalDoc->boundingBox().llx()).arg(-internalDoc->boundingBox().lly()); argus << "-f" << filename; - } - else - { + } else argus << "-f" << tempPSfile.name(); - } - //kDebug() << argus.join(" ") << endl; - proc << argus; kDebug() << "start ghostscript for page " << currentPageNumber << "." << endl;