Bump version to 21.06.18.1
[LibreOffice.git] / include / vcl / pdfread.hxx
blobb693c432302be019e77225790e6632d09f8523e6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #ifndef INCLUDED_VCL_SOURCE_FILTER_IPDF_PDFREAD_HXX
11 #define INCLUDED_VCL_SOURCE_FILTER_IPDF_PDFREAD_HXX
13 #include <vector>
14 #include <tools/gen.hxx>
15 #include <tools/stream.hxx>
16 #include <tools/color.hxx>
17 #include <vcl/graph.hxx>
18 #include <basegfx/range/b2drectangle.hxx>
19 #include <com/sun/star/util/DateTime.hpp>
21 #include <vcl/pdf/PDFAnnotationSubType.hxx>
22 #include <vcl/pdf/PDFAnnotationMarker.hxx>
24 namespace com::sun::star::uno
26 template <typename> class Sequence;
28 class Bitmap;
30 namespace vcl
32 /// Fills the rBitmaps vector with rendered pages.
33 VCL_DLLPUBLIC size_t RenderPDFBitmaps(const void* pBuffer, int nSize,
34 std::vector<BitmapEx>& rBitmaps, size_t nFirstPage = 0,
35 int nPages = 1, const basegfx::B2DTuple* pSizeHint = nullptr);
37 /// Imports a PDF stream into rGraphic as VectorGraphicData.
38 VCL_DLLPUBLIC bool ImportPDF(SvStream& rStream, Graphic& rGraphic);
40 struct PDFGraphicAnnotation
42 OUString maAuthor;
43 OUString maText;
45 basegfx::B2DRectangle maRectangle; // In HMM
46 css::util::DateTime maDateTime;
48 Color maColor;
50 pdf::PDFAnnotationSubType meSubType;
51 std::shared_ptr<pdf::PDFAnnotationMarker> mpMarker;
54 class PDFGraphicResult
56 Graphic maGraphic;
57 // Size in HMM
58 Size maSize;
60 std::vector<PDFGraphicAnnotation> maAnnotations;
62 public:
63 PDFGraphicResult(Graphic aGraphic, Size const& rSize,
64 std::vector<PDFGraphicAnnotation> aAnnotations)
65 : maGraphic(std::move(aGraphic))
66 , maSize(rSize)
67 , maAnnotations(std::move(aAnnotations))
71 const Graphic& GetGraphic() const { return maGraphic; }
72 const Size& GetSize() const { return maSize; }
73 const std::vector<PDFGraphicAnnotation>& GetAnnotations() const { return maAnnotations; }
76 /// Import PDF as Graphic images (1 per page), but not loaded yet.
77 /// Returns the number of pages read.
78 VCL_DLLPUBLIC size_t ImportPDFUnloaded(const OUString& rURL,
79 std::vector<PDFGraphicResult>& rGraphics);
82 #endif // INCLUDED_VCL_SOURCE_FILTER_IPDF_PDFREAD_HXX
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */