summaryrefslogtreecommitdiff
path: root/sd/source/filter/pdf/sdpdffilter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/filter/pdf/sdpdffilter.cxx')
-rw-r--r--sd/source/filter/pdf/sdpdffilter.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx
index 71eecabfb3b0..cc7be1936e61 100644
--- a/sd/source/filter/pdf/sdpdffilter.cxx
+++ b/sd/source/filter/pdf/sdpdffilter.cxx
@@ -98,9 +98,12 @@ bool SdPdfFilter::Import()
const OUString aFileName(
mrMedium.GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::NONE));
+ // Rendering resolution.
+ const double dResolutionDPI = 96.;
+
uno::Sequence<sal_Int8> aPdfData;
std::vector<Bitmap> aBitmaps;
- if (vcl::ImportPDF(aFileName, aBitmaps, aPdfData) == 0)
+ if (vcl::ImportPDF(aFileName, aBitmaps, aPdfData, dResolutionDPI) == 0)
return false;
// Prepare the link with the PDF stream.
@@ -128,8 +131,12 @@ bool SdPdfFilter::Import()
// Create the page and insert the Graphic.
SdPage* pPage = mrDocument.GetSdPage(nPageNumber++, PageKind::Standard);
- const Size aGrfSize(OutputDevice::LogicToLogic(
- aGraphic.GetPrefSize(), aGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)));
+ Size aGrfSize(OutputDevice::LogicToLogic(aGraphic.GetPrefSize(), aGraphic.GetPrefMapMode(),
+ MapMode(MapUnit::Map100thMM)));
+
+ // Resize to original size based on 72 dpi to preserve page size.
+ aGrfSize = Size(aGrfSize.Width() * 72. / dResolutionDPI,
+ aGrfSize.Height() * 72. / dResolutionDPI);
// Make the page size match the rendered image.
pPage->SetSize(aGrfSize);