diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-10-28 08:37:32 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-10-28 10:55:45 +0100 |
commit | 49a39d1abccc61b6dace3e92059ae50a6a2c298d (patch) | |
tree | 694e4b4985318dd107d784af46e8da79f08d21e2 /vcl | |
parent | e19d85856e9c9e1c33971b350ab74de278185fe0 (diff) |
pdfium: add an FPDF_RenderPageBitmap() wrapper
Change-Id: I2238aeb4b2f7483440ded2600a328436f861f178
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104917
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/ipdf/pdfread.cxx | 4 | ||||
-rw-r--r-- | vcl/source/pdf/PDFiumLibrary.cxx | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx index 3e0207e86bd5..c027acb38777 100644 --- a/vcl/source/filter/ipdf/pdfread.cxx +++ b/vcl/source/filter/ipdf/pdfread.cxx @@ -180,8 +180,8 @@ size_t RenderPDFBitmaps(const void* pBuffer, int nSize, std::vector<BitmapEx>& r } const sal_uInt32 nColor = bTransparent ? 0x00000000 : 0xFFFFFFFF; pPdfBitmap->fillRect(0, 0, nPageWidth, nPageHeight, nColor); - FPDF_RenderPageBitmap(pPdfBitmap->getPointer(), pPdfPage->getPointer(), /*start_x=*/0, - /*start_y=*/0, nPageWidth, nPageHeight, /*rotate=*/0, /*flags=*/0); + pPdfBitmap->renderPageBitmap(pPdfPage.get(), /*start_x=*/0, + /*start_y=*/0, nPageWidth, nPageHeight); // Save the buffer as a bitmap. Bitmap aBitmap(Size(nPageWidth, nPageHeight), 24); diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx index 607ad7ab9d2c..c3deee13d889 100644 --- a/vcl/source/pdf/PDFiumLibrary.cxx +++ b/vcl/source/pdf/PDFiumLibrary.cxx @@ -503,6 +503,13 @@ void PDFiumBitmap::fillRect(int left, int top, int width, int height, sal_uInt32 FPDFBitmap_FillRect(mpBitmap, left, top, width, height, nColor); } +void PDFiumBitmap::renderPageBitmap(PDFiumPage* pPage, int nStartX, int nStartY, int nSizeX, + int nSizeY) +{ + FPDF_RenderPageBitmap(mpBitmap, pPage->getPointer(), nStartX, nStartY, nSizeX, nSizeY, + /*rotate=*/0, /*flags=*/0); +} + PDFiumAnnotation::PDFiumAnnotation(FPDF_ANNOTATION pAnnotation) : mpAnnotation(pAnnotation) { |