summaryrefslogtreecommitdiff
path: root/vcl/source/pdf/PDFiumLibrary.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/pdf/PDFiumLibrary.cxx')
-rw-r--r--vcl/source/pdf/PDFiumLibrary.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx
index b8d0cb536be7..074863156f97 100644
--- a/vcl/source/pdf/PDFiumLibrary.cxx
+++ b/vcl/source/pdf/PDFiumLibrary.cxx
@@ -362,6 +362,17 @@ Size PDFiumPageObject::getImageSize(PDFiumPage& rPage)
return Size(aMeta.width, aMeta.height);
}
+std::unique_ptr<PDFiumBitmap> PDFiumPageObject::getImageBitmap()
+{
+ std::unique_ptr<PDFiumBitmap> pPDFiumBitmap;
+ FPDF_BITMAP pBitmap = FPDFImageObj_GetBitmap(mpPageObject);
+ if (pBitmap)
+ {
+ pPDFiumBitmap = std::make_unique<PDFiumBitmap>(pBitmap);
+ }
+ return pPDFiumBitmap;
+}
+
BitmapChecksum PDFiumPage::getChecksum()
{
size_t nPageWidth = getWidth();
@@ -414,6 +425,19 @@ bool PDFiumPathSegment::isClosed() const { return FPDFPathSegment_GetClose(mpPat
int PDFiumPathSegment::getType() const { return FPDFPathSegment_GetType(mpPathSegment); }
+PDFiumBitmap::PDFiumBitmap(FPDF_BITMAP pBitmap)
+ : mpBitmap(pBitmap)
+{
+}
+
+PDFiumBitmap::~PDFiumBitmap()
+{
+ if (mpBitmap)
+ {
+ FPDFBitmap_Destroy(mpBitmap);
+ }
+}
+
PDFiumAnnotation::PDFiumAnnotation(FPDF_ANNOTATION pAnnotation)
: mpAnnotation(pAnnotation)
{