[PATCH] KPDF - Print with the correct page size
David Faure
faure at kde.org
Mon Feb 28 00:01:43 GMT 2005
On Monday 28 February 2005 00:09, Albert Astals Cid wrote:
> Hi, i think that may be a candidate to commit to KDE_3_4_BRANCH.
>
> The problem lies in that kpdf was not setting the pagesize of what it was
> printing according to what KPrinter said, instead it was printing the page
> size specified in /etc/xpdfrc or Letter as default, this is obviously wrong
> and that patch fixes it (at least the user that reported the problem says it
> seems to work, i don't have different paper sizes to try)
>
> Related bug: http://bugs.kde.org/show_bug.cgi?id=100003
>
> May i commit it to KDE_3_4_BRANCH?
+ QRegExp re = QRegExp("w\\d+h\\d+");
+ if (ps.find(QRegExp("w\\d+h\\d+")) == 0)
should obviously by ps.find(re)
+ ps = ps.mid(1);
+ int hPos = ps.find("h");
Hmm, OK. You could also have used capturing in the regexp :)
But anyway - why use QPaintDeviceMetrics on a dummy printer instead of using
it on "printer" itself (the argument to the method) ?
--
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the kde-core-devel
mailing list