summaryrefslogtreecommitdiff
path: root/vcl/source/filter/ipdf/pdfread.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/filter/ipdf/pdfread.cxx')
-rw-r--r--vcl/source/filter/ipdf/pdfread.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx
index 7083c4a9cc99..52a6f7a3af89 100644
--- a/vcl/source/filter/ipdf/pdfread.cxx
+++ b/vcl/source/filter/ipdf/pdfread.cxx
@@ -216,12 +216,12 @@ bool getCompatibleStream(SvStream& rInStream, SvStream& rOutStream, sal_uInt64 n
namespace vcl
{
-bool ImportPDF(SvStream& rStream, Bitmap& rBitmap, css::uno::Sequence<sal_Int8>& rPdfData,
- sal_uInt64 nPos, sal_uInt64 nSize)
+bool ImportPDF(SvStream& rStream, Bitmap& rBitmap, size_t nPageIndex,
+ css::uno::Sequence<sal_Int8>& rPdfData, sal_uInt64 nPos, sal_uInt64 nSize)
{
// Get the preview of the first page.
std::vector<Bitmap> aBitmaps;
- if (generatePreview(rStream, aBitmaps, nPos, nSize, 0, 1) != 1)
+ if (generatePreview(rStream, aBitmaps, nPos, nSize, nPageIndex, 1) != 1 || aBitmaps.empty())
return false;
rBitmap = aBitmaps[0];
@@ -243,7 +243,7 @@ bool ImportPDF(SvStream& rStream, Graphic& rGraphic)
{
uno::Sequence<sal_Int8> aPdfData;
Bitmap aBitmap;
- const bool bRet = ImportPDF(rStream, aBitmap, aPdfData);
+ const bool bRet = ImportPDF(rStream, aBitmap, 0, aPdfData);
rGraphic = aBitmap;
rGraphic.setPdfData(std::make_shared<css::uno::Sequence<sal_Int8>>(aPdfData));
rGraphic.setPageNumber(0); // We currently import only the first page.