62#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
63 Poppler::Document* pdoc = Poppler::Document::loadFromData(io->readAll());
65 std::unique_ptr<Poppler::Document> pdoc = Poppler::Document::loadFromData(io->readAll());
68 dbgFile <<
"Error when reading the PDF";
72 pdoc->setRenderHint(Poppler::Document::Antialiasing,
true);
73 pdoc->setRenderHint(Poppler::Document::TextAntialiasing,
true);
75 while (pdoc->isLocked()) {
76 KPasswordDialog dlg(0);
77 dlg.setPrompt(i18n(
"A password is required to read that pdf"));
78 dlg.setWindowTitle(i18n(
"A password is required to read that pdf"));
79 if (dlg.exec() != QDialog::Accepted) {
83 pdoc->unlock(dlg.password().toLocal8Bit(), dlg.password().toLocal8Bit());
90#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
101 if (kdb->exec() == QDialog::Rejected) {
102#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
112 int width = wdg->intWidth->value();
113 int height = wdg->intHeight->value();
114 KisImageSP image =
new KisImage(document->createUndoStore(), width, height, cs,
"built image");
115 image->
setResolution(wdg->intResolution->value() / 72.0, wdg->intResolution->value() / 72.0);
121 i18n(
"Page %1", *it + 1),
124#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
125 Poppler::Page* page = pdoc->page(*it);
127 std::unique_ptr<Poppler::Page> page = pdoc->page(*it);
130 QImage img = page->renderToImage(wdg->intResolution->value(), wdg->intResolution->value(), 0, 0, width, height);
137 document->setCurrentImage(image);
138#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))