summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
Diffstat (limited to 'svx')
-rw-r--r--svx/source/inc/svdpdf.hxx4
-rw-r--r--svx/source/svdraw/svdpdf.cxx14
2 files changed, 6 insertions, 12 deletions
diff --git a/svx/source/inc/svdpdf.hxx b/svx/source/inc/svdpdf.hxx
index cc3ec7f27bfa..3765f8a59577 100644
--- a/svx/source/inc/svdpdf.hxx
+++ b/svx/source/inc/svdpdf.hxx
@@ -45,6 +45,8 @@
#include <postwin.h>
#include <fpdfview.h>
+#include <vcl/filter/PDFiumLibrary.hxx>
+
// Forward Declarations
class SfxItemSet;
@@ -104,6 +106,8 @@ class SVXCORE_DLLPUBLIC ImpSdrPdfImport final
tools::Rectangle PointsToLogic(double left, double right, double top, double bottom) const;
Point PointsToLogic(double x, double y) const;
+ std::shared_ptr<vcl::pdf::PDFium> mpPDFium;
+
// check for clip and evtl. fill maClip
void checkClip();
bool isClip() const;
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx
index b380d478d806..f539d56ca355 100644
--- a/svx/source/svdraw/svdpdf.cxx
+++ b/svx/source/svdraw/svdpdf.cxx
@@ -131,6 +131,7 @@ ImpSdrPdfImport::ImpSdrPdfImport(SdrModel& rModel, SdrLayerID nLay, const tools:
, mnPageCount(0)
, mdPageWidthPts(0)
, mdPageHeightPts(0)
+ , mpPDFium(vcl::pdf::PDFiumLibrary::get())
{
mpVD->EnableOutput(false);
mpVD->SetLineColor();
@@ -144,13 +145,6 @@ ImpSdrPdfImport::ImpSdrPdfImport(SdrModel& rModel, SdrLayerID nLay, const tools:
svl::Items<EE_ITEMS_START, EE_ITEMS_END>{});
checkClip();
- FPDF_LIBRARY_CONFIG aConfig;
- aConfig.version = 2;
- aConfig.m_pUserFontPaths = nullptr;
- aConfig.m_pIsolate = nullptr;
- aConfig.m_v8EmbedderSlot = 0;
- FPDF_InitLibraryWithConfig(&aConfig);
-
// Load the buffer using pdfium.
auto const& rVectorGraphicData = mrGraphic.getVectorGraphicData();
mpPdfDocument = FPDF_LoadMemDocument(
@@ -185,11 +179,7 @@ ImpSdrPdfImport::ImpSdrPdfImport(SdrModel& rModel, SdrLayerID nLay, const tools:
mnPageCount = FPDF_GetPageCount(mpPdfDocument);
}
-ImpSdrPdfImport::~ImpSdrPdfImport()
-{
- FPDF_CloseDocument(mpPdfDocument);
- FPDF_DestroyLibrary();
-}
+ImpSdrPdfImport::~ImpSdrPdfImport() { FPDF_CloseDocument(mpPdfDocument); }
void ImpSdrPdfImport::DoObjects(SvdProgressInfo* pProgrInfo, sal_uInt32* pActionsToReport,
int nPageIndex)