summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-06-28 10:12:17 +0200
committerTomaž Vajngerl <quikee@gmail.com>2020-06-29 14:35:37 +0200
commit440cb3fb80d9fd356871eac410b9797f23433722 (patch)
treed9c21ba1bfaeef1a5a4f895af72d94b5d31dc82b /include
parent34745b022d0c58e262c7ad3bfd103e769b2cdd18 (diff)
pdf: add PDFiumTextPage and PDFiumPageObject + test
Also use it in ImpSdrPdfImport. Change-Id: I6d353ef60d036c3516448e64a50b25a9befd5db8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97364 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/filter/PDFiumLibrary.hxx40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx
index 35826097e45e..501f964f395d 100644
--- a/include/vcl/filter/PDFiumLibrary.hxx
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -69,6 +69,41 @@ public:
std::unique_ptr<PDFiumAnnotation> getLinked(OString const& rKey);
};
+class PDFiumTextPage;
+
+class VCL_DLLPUBLIC PDFiumPageObject final
+{
+private:
+ FPDF_PAGEOBJECT mpPageObject;
+
+ PDFiumPageObject(const PDFiumPageObject&) = delete;
+ PDFiumPageObject& operator=(const PDFiumPageObject&) = delete;
+
+public:
+ PDFiumPageObject(FPDF_PAGEOBJECT pPageObject);
+ ~PDFiumPageObject();
+
+ FPDF_PAGEOBJECT getPointer() { return mpPageObject; }
+
+ int getType();
+ OUString getText(std::unique_ptr<PDFiumTextPage> const& pTextPage);
+};
+
+class VCL_DLLPUBLIC PDFiumTextPage final
+{
+private:
+ FPDF_TEXTPAGE mpTextPage;
+
+ PDFiumTextPage(const PDFiumTextPage&) = delete;
+ PDFiumTextPage& operator=(const PDFiumTextPage&) = delete;
+
+public:
+ PDFiumTextPage(FPDF_TEXTPAGE pTextPage);
+ ~PDFiumTextPage();
+
+ FPDF_TEXTPAGE getPointer() { return mpTextPage; }
+};
+
class VCL_DLLPUBLIC PDFiumPage final
{
private:
@@ -92,10 +127,15 @@ public:
FPDF_PAGE getPointer() { return mpPage; }
+ int getObjectCount();
+ std::unique_ptr<PDFiumPageObject> getObject(int nIndex);
+
int getAnnotationCount();
int getAnnotationIndex(std::unique_ptr<PDFiumAnnotation> const& rAnnotation);
std::unique_ptr<PDFiumAnnotation> getAnnotation(int nIndex);
+
+ std::unique_ptr<PDFiumTextPage> getTextPage();
};
class VCL_DLLPUBLIC PDFiumDocument final