r22089 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Wed Jun 28 17:34:35 UTC 2017
Author: jghali
Date: Wed Jun 28 17:34:35 2017
New Revision: 22089
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22089
Log:
fix PDF import issue when imported PDF contains pages with different media boxes
Modified:
trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22089&path=/trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp Wed Jun 28 17:34:35 2017
@@ -667,6 +667,7 @@
firstPg = false;
else
m_Doc->addPage(ap);
+ QRectF mdBox = getCBox(0, pp);
QRectF crBox = getCBox(contentRect, pp);
if (cropped)
{
@@ -725,7 +726,7 @@
// currentLayer = m_Doc->activeLayer();
oc->setState(OptionalContentGroup::On);
if (cropped)
- pdfDoc->displayPageSlice(dev, pp, hDPI, vDPI, rotate, useMediaBox, crop, printing, crBox.x(), mediaRect.bottom() - crBox.bottom(), crBox.width(), crBox.height(), NULL, NULL, dev->annotations_callback, dev);
+ pdfDoc->displayPageSlice(dev, pp, hDPI, vDPI, rotate, useMediaBox, crop, printing, crBox.x() - mdBox.x(), mdBox.bottom() - crBox.bottom(), crBox.width(), crBox.height(), NULL, NULL, dev->annotations_callback, dev);
else
pdfDoc->displayPage(dev, pp, hDPI, vDPI, rotate, useMediaBox, crop, printing, NULL, NULL, dev->annotations_callback, dev);
oc->setState(OptionalContentGroup::Off);
@@ -740,7 +741,7 @@
else
{
if (cropped)
- pdfDoc->displayPageSlice(dev, pp, hDPI, vDPI, rotate, useMediaBox, crop, printing, crBox.x(), mediaRect.bottom() - crBox.bottom(), crBox.width(), crBox.height(), NULL, NULL, dev->annotations_callback, dev);
+ pdfDoc->displayPageSlice(dev, pp, hDPI, vDPI, rotate, useMediaBox, crop, printing, crBox.x() - mdBox.x(), mdBox.bottom() - crBox.bottom(), crBox.width(), crBox.height(), NULL, NULL, dev->annotations_callback, dev);
else
pdfDoc->displayPage(dev, pp, hDPI, vDPI, rotate, useMediaBox, crop, printing, NULL, NULL, dev->annotations_callback, dev);
}
More information about the scribus-commit
mailing list