diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-04-08 20:34:29 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-06-01 08:59:13 +0200 |
commit | fffc15fc36ac9c6b4a609c3d5a7322573d1e3d29 (patch) | |
tree | 455e58109eb2c673263e485caf5cc6522dee5e2d /sd/source | |
parent | 675b2f78b7525a7995a468d82694baa40110e441 (diff) |
svx: import PDF text using PDFium
Change-Id: I7c75477f5257931f5182b8d65e898857526bf555
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/filter/pdf/sdpdffilter.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx index 50b4fb1a6fd2..1e17d91e5655 100644 --- a/sd/source/filter/pdf/sdpdffilter.cxx +++ b/sd/source/filter/pdf/sdpdffilter.cxx @@ -129,10 +129,11 @@ bool SdPdfFilter::Import() // Create the page and insert the Graphic. SdPage* pPage = mrDocument.GetSdPage(nPageNumber++, PageKind::Standard); - Point aPos; - Size aPagSize(pPage->GetSize()); + + SAL_WARN("sd.filter", "Graphic PrefSize: " << aGraphic.GetPrefSize()); Size aGrfSize(OutputDevice::LogicToLogic(aGraphic.GetPrefSize(), aGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM))); + SAL_WARN("sd.filter", "Graphic Logic Size: " << aGrfSize); Size aPagSize(pPage->GetSize()); aPagSize.AdjustWidth(-(pPage->GetLftBorder() + pPage->GetRgtBorder())); @@ -142,8 +143,8 @@ bool SdPdfFilter::Import() if (((aGrfSize.Height() > aPagSize.Height()) || (aGrfSize.Width() > aPagSize.Width())) && aGrfSize.Height() && aPagSize.Height()) { - double fGrfWH = static_cast<double>(aGrfSize.Width()) / aGrfSize.Height(); - double fWinWH = static_cast<double>(aPagSize.Width()) / aPagSize.Height(); + const double fGrfWH = static_cast<double>(aGrfSize.Width()) / aGrfSize.Height(); + const double fWinWH = static_cast<double>(aPagSize.Width()) / aPagSize.Height(); // adjust graphic to page size (scales) if (fGrfWH < fWinWH) @@ -163,6 +164,8 @@ bool SdPdfFilter::Import() aPos.setX(((aPagSize.Width() - aGrfSize.Width()) >> 1) + pPage->GetLftBorder()); aPos.setY(((aPagSize.Height() - aGrfSize.Height()) >> 1) + pPage->GetUppBorder()); + SAL_WARN("sd.filter", "Graphic Pos: " << aPos); + SAL_WARN("sd.filter", "Graphic Logic Size: " << aGrfSize); pPage->InsertObject(new SdrGrafObj(aGraphic, tools::Rectangle(aPos, aGrfSize))); } |