Implement bare-bones printing for the png generator, leak--

svn path=/trunk/kdegraphics/kpdf/; revision=401093
remotes/origin/kpdf-kde4
Albert Astals Cid 21 years ago
parent 7b0fb39117
commit d1dd22b280
  1. 9
      core/generator_png/generator_png.cpp
  2. 3
      core/generator_png/generator_png.h

@ -7,7 +7,9 @@
* (at your option) any later version. *
***************************************************************************/
#include <qpainter.h>
#include <qpixmap.h>
#include <kprinter.h>
#include "core/page.h"
#include "generator_png.h"
@ -18,6 +20,7 @@ PNGGenerator::PNGGenerator( KPDFDocument * document ) : Generator( document )
PNGGenerator::~PNGGenerator()
{
delete m_pix;
}
bool PNGGenerator::loadDocument( const QString & fileName, QValueVector<KPDFPage*> & pagesVector )
@ -60,3 +63,9 @@ bool PNGGenerator::hasFonts() const
void PNGGenerator::putFontInfo( KListView * )
{
}
bool PNGGenerator::print( KPrinter& printer )
{
QPainter p(&printer);
p.drawPixmap(0, 0, *m_pix);
}

@ -33,6 +33,9 @@ class PNGGenerator : public Generator
// font related
void putFontInfo(KListView *list);
// [INHERITED] print document using already configured kprinter
bool print( KPrinter& printer );
private:
QPixmap *m_pix;
};

Loading…
Cancel
Save