1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #ifndef INCLUDED_VCL_SOURCE_FILTER_IPDF_PDFREAD_HXX
11 #define INCLUDED_VCL_SOURCE_FILTER_IPDF_PDFREAD_HXX
14 #include <tools/gen.hxx>
15 #include <tools/stream.hxx>
16 #include <vcl/graph.hxx>
17 #include <basegfx/range/b2drectangle.hxx>
18 #include <com/sun/star/util/DateTime.hpp>
19 #include <basegfx/tuple/b2dtuple.hxx>
21 namespace com::sun::star::uno
23 template <typename
> class Sequence
;
29 /// Fills the rBitmaps vector with rendered pages.
30 VCL_DLLPUBLIC
size_t RenderPDFBitmaps(const void* pBuffer
, int nSize
, std::vector
<Bitmap
>& rBitmaps
,
31 size_t nFirstPage
= 0, int nPages
= 1,
32 const basegfx::B2DTuple
* pSizeHint
= nullptr);
34 /// Imports a PDF stream into rGraphic as VectorGraphicData.
35 VCL_DLLPUBLIC
bool ImportPDF(SvStream
& rStream
, Graphic
& rGraphic
);
37 struct PDFGraphicAnnotation
42 basegfx::B2DRectangle maRectangle
;
43 css::util::DateTime maDateTime
;
46 struct PDFGraphicResult
52 std::vector
<PDFGraphicAnnotation
> maAnnotations
;
54 PDFGraphicResult(Graphic
const& rGraphic
, Size
const& rSize
,
55 std::vector
<PDFGraphicAnnotation
> const& aAnnotations
)
58 , maAnnotations(aAnnotations
)
63 /// Import PDF as Graphic images (1 per page), but not loaded yet.
64 /// Returns the number of pages read.
65 VCL_DLLPUBLIC
size_t ImportPDFUnloaded(const OUString
& rURL
,
66 std::vector
<PDFGraphicResult
>& rGraphics
);
69 #endif // INCLUDED_VCL_SOURCE_FILTER_IPDF_PDFREAD_HXX
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */