Version: (using KDE KDE 3.3.92) Installed from: Gentoo Packages Compiler: gcc (GCC) 3.4.3 20050110 (Gentoo Linux 3.4.3.20050110, ssp-3.4.3.20050110-0, pie-8.7.7) OS: Linux Printing any document from kpdf always causes my printer to ask me to insert letter paper. But in kde-settings a4 is my default paper type, and the pdfs are in a4. Also the printers (cups) paper size is a4. This does not happen with acroread, it does not happen with kghostview nor does it happen when printing the pdf on the command line.
True, the code that makes the print is not 100% correct, i'm working on that.
Its not fixed in rc1. This bug is annoying, you should realy fix it before the 3.4 release.
And you should be more polite. It is not going to be fixed for KDE 3.4.0
This prevents all non-letter users (even you ?) from printing with kpdf. I would call this a showstoper.
But i don't have a working patch and KDE is not going to stop only for kpdf so it'll have to wait for KDE 3.4.1. I'll tell you how a dirty fix, create a file called /etc/xpdfrc and put inside of it psPaperSize A4 That will make kpdf print allways using A4
Well, i've found that it may not be that hard to fix, are you in position to try a patch?
Created attachment 9875 [details] Patch that may fix the page size problem If you don't know how to apply a patch do not hesitate to ask
Does not work here. Patch applys fine, but it does not solve the problem.
Created attachment 9876 [details] Second try to fix paper size problem Well, i did a big error as removed a line to make it look better and forgot to add it :-( Please try with this patch.
You're great man! It seems to work now. My printer doesnt complain now. Will do some further tests tomorow. Thank you very much.
CVS commit by aacid: Print to the correct page size Olaf can you check that fixes your wrong paper format complaining printer too? CCMAIL: 98837@bugs.kde.org BUGS: 100003 M +24 -0 generator_pdf.cpp 1.23 --- kdegraphics/kpdf/core/generator_pdf/generator_pdf.cpp #1.22:1.23 @@ -14,4 +14,6 @@ #include <qimage.h> #include <qapplication.h> +#include <qpaintdevicemetrics.h> +#include <qregexp.h> #include <klocale.h> #include <kpassdlg.h> @@ -297,4 +299,26 @@ void PDFGenerator::generateSyncTextPage( bool PDFGenerator::print( KPrinter& printer ) { + QString ps = printer.option("PageSize"); + if (ps.find(QRegExp("w\\d+h\\d+")) == 0) + { + // size not supported by Qt, KPrinter gives us the size as wWIDTHhHEIGHT + // remove the w + ps = ps.mid(1); + int hPos = ps.find("h"); + globalParams->setPSPaperWidth(ps.left(hPos).toInt()); + globalParams->setPSPaperHeight(ps.mid(hPos+1).toInt()); + } + else + { + // size is supported by Qt, we get either the pageSize name or nothing because the default pageSize is used + QPrinter dummy(QPrinter::PrinterResolution); + dummy.setFullPage(true); + dummy.setPageSize((QPrinter::PageSize)(ps.isEmpty() ? KGlobal::locale()->pageSize() : pageNameToPageSize(ps))); + + QPaintDeviceMetrics metrics(&dummy); + globalParams->setPSPaperWidth(metrics.width()); + globalParams->setPSPaperHeight(metrics.height()); + } + KTempFile tf( QString::null, ".ps" ); PSOutputDev *psOut = new PSOutputDev(tf.name().latin1(), pdfdoc->getXRef(), pdfdoc->getCatalog(), 1, pdfdoc->getNumPages(), psModePS);