From 7cbb10598d6b1a0f5e0d612eb6ffc1df28d086e4 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Mon, 6 Jul 2020 14:08:23 +0200 Subject: pdf: add PDFiumPathSegment to the wrapper & use in ImpSdrPdfImport MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A PageObject of type FPDF_PAGEOBJ_PATH can have a path segment, that is common in vector graphic objects. The path segment is wrapped into PDFiumPathSegment which can be used to handle the path and path properties. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98210 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl (cherry picked from commit bc8016b81c2c609711c26af1f85da327cf30a4ff) Change-Id: I990d51ba90fa356a6eca137eb4b71947858289aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99879 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl --- include/vcl/filter/PDFiumLibrary.hxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include') diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx index f7dcc4b2c99e..43176f584420 100644 --- a/include/vcl/filter/PDFiumLibrary.hxx +++ b/include/vcl/filter/PDFiumLibrary.hxx @@ -73,6 +73,24 @@ public: class PDFiumTextPage; +class VCL_DLLPUBLIC PDFiumPathSegment final +{ +private: + FPDF_PATHSEGMENT mpPathSegment; + + PDFiumPathSegment(const PDFiumPathSegment&) = delete; + PDFiumPathSegment& operator=(const PDFiumPathSegment&) = delete; + +public: + PDFiumPathSegment(FPDF_PATHSEGMENT pPathSegment); + ~PDFiumPathSegment(); + + FPDF_PATHSEGMENT getPointer() { return mpPathSegment; } + basegfx::B2DPoint getPoint(); + bool isClosed(); + int getType(); +}; + class VCL_DLLPUBLIC PDFiumPageObject final { private: @@ -100,6 +118,9 @@ public: int getTextRenderMode(); Color getFillColor(); Color getStrokeColor(); + // Path + int getPathSegmentCount(); + std::unique_ptr getPathSegment(int index); }; class VCL_DLLPUBLIC PDFiumTextPage final -- cgit