diff --git a/generators/ghostview/generator_ghostview.cpp b/generators/ghostview/generator_ghostview.cpp index 5e7af6027..b11371587 100644 --- a/generators/ghostview/generator_ghostview.cpp +++ b/generators/ghostview/generator_ghostview.cpp @@ -359,7 +359,6 @@ void GSGenerator::generatePixmap( Okular::PixmapRequest * req ) // TODO check if needed // asyncGenerator->setOrientation(rotation (internalDoc->orientation(pgNo))); -// asyncGenerator->setSize( reqwidth, reqheight ); asyncGenerator->setMedia( internalDoc -> getPaperSize ( internalDoc -> pageMedia( pgNo )) ); asyncGenerator->setMagnify( qMax( (double)reqwidth / width, (double)reqheight / height ) ); PsPosition u=internalDoc->pagePos(pgNo); diff --git a/generators/ghostview/gshandler.cpp b/generators/ghostview/gshandler.cpp index a5c7dde54..3fcb87ddd 100644 --- a/generators/ghostview/gshandler.cpp +++ b/generators/ghostview/gshandler.cpp @@ -113,7 +113,7 @@ GSHandler::GSHandler() m_ghostScriptInstance = 0; } -void GSHandler::init(const QString &media, double magnify, bool plaformFonts, int aaText, int aaGfx, GSInterpreterCMD *interpreter) +void GSHandler::init(const QString &media, double magnify, int width, int height, bool plaformFonts, int aaText, int aaGfx, GSInterpreterCMD *interpreter) { int errorCode; @@ -138,6 +138,7 @@ void GSHandler::init(const QString &media, double magnify, bool plaformFonts, in << QString("-dTextAlphaBits=%1").arg(aaText) << QString("-dGraphicsAlphaBits=%1").arg(aaGfx) << QString("-sPAPERSIZE=%1").arg(media.toLower()) + << QString().sprintf("-g%dx%d", width, height) << QString().sprintf("-r%fx%f", (magnify * Okular::Utils::dpiX()), (magnify * Okular::Utils::dpiY())) << QString().sprintf("-dDisplayFormat=%d", DISPLAY_COLORS_RGB | DISPLAY_UNUSED_LAST | DISPLAY_DEPTH_8 | DISPLAY_LITTLEENDIAN | DISPLAY_TOPFIRST) diff --git a/generators/ghostview/gshandler.h b/generators/ghostview/gshandler.h index 8cc2e30bd..26c7f615d 100644 --- a/generators/ghostview/gshandler.h +++ b/generators/ghostview/gshandler.h @@ -24,6 +24,8 @@ class GSHandler void init(const QString &media, double magnify, + int width, + int height, bool plaformFonts, int aaText, int aaGfx, diff --git a/generators/ghostview/interpreter_cmd.cpp b/generators/ghostview/interpreter_cmd.cpp index 5bd5290a0..e0f5d8fa0 100644 --- a/generators/ghostview/interpreter_cmd.cpp +++ b/generators/ghostview/interpreter_cmd.cpp @@ -86,7 +86,7 @@ void GSInterpreterCMD::fordwardImage(QImage *image) { if (image->width() != m_request->width() || image->height() != m_request->height()) { - kDebug(4656) << "Generated image does not match wanted size " << image->width() << " " << m_request->width() << " " << image->height() << " " << m_request->height() << endl; + kWarning(4656) << "Generated image does not match wanted size " << image->width() << " " << m_request->width() << " " << image->height() << " " << m_request->height() << endl; QImage aux = image->scaled(m_request->width(), m_request->height()); delete image; image = new QImage(aux); @@ -108,7 +108,7 @@ void GSInterpreterCMD::run() while(1) { m_semaphore.acquire(); - m_handler->init(m_media, m_magnify, m_pfonts, m_aaText, m_aaGfx, this); + m_handler->init(m_media, m_magnify, m_request->width(), m_request->height(), m_pfonts, m_aaText, m_aaGfx, this); // send structural information if (m_sendStructure)