LibreOffice Module vcl (master)  1
pdfread.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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  */
9 
10 #ifndef INCLUDED_VCL_SOURCE_FILTER_IPDF_PDFREAD_HXX
11 #define INCLUDED_VCL_SOURCE_FILTER_IPDF_PDFREAD_HXX
12 
13 #include <vector>
14 #include <tools/gen.hxx>
15 #include <tools/stream.hxx>
16 #include <tools/color.hxx>
17 #include <vcl/graph.hxx>
19 #include <com/sun/star/util/DateTime.hpp>
20 
23 
24 namespace com::sun::star::uno
25 {
26 template <typename> class Sequence;
27 }
28 class Bitmap;
29 
30 namespace vcl
31 {
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);
36 
38 VCL_DLLPUBLIC bool
40  std::shared_ptr<VectorGraphicData>& rVectorGraphicData);
41 
43 VCL_DLLPUBLIC bool ImportPDF(SvStream& rStream, Graphic& rGraphic);
44 
46 {
47  OUString maAuthor;
48  OUString maText;
49 
51  css::util::DateTime maDateTime;
52 
54 
56  std::shared_ptr<pdf::PDFAnnotationMarker> mpMarker;
57 };
58 
60 {
62  // Size in HMM
64 
65  std::vector<PDFGraphicAnnotation> maAnnotations;
66 
67 public:
68  PDFGraphicResult(Graphic aGraphic, Size const& rSize,
69  std::vector<PDFGraphicAnnotation> aAnnotations)
70  : maGraphic(std::move(aGraphic))
71  , maSize(rSize)
72  , maAnnotations(std::move(aAnnotations))
73  {
74  }
75 
76  const Graphic& GetGraphic() const { return maGraphic; }
77  const Size& GetSize() const { return maSize; }
78  const std::vector<PDFGraphicAnnotation>& GetAnnotations() const { return maAnnotations; }
79 };
80 
83 VCL_DLLPUBLIC size_t ImportPDFUnloaded(const OUString& rURL,
84  std::vector<PDFGraphicResult>& rGraphics);
85 }
86 
87 #endif // INCLUDED_VCL_SOURCE_FILTER_IPDF_PDFREAD_HXX
88 
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
size_t RenderPDFBitmaps(const void *pBuffer, int nSize, std::vector< BitmapEx > &rBitmaps, const size_t nFirstPage, int nPages, const basegfx::B2DTuple *pSizeHint)
Fills the rBitmaps vector with rendered pages.
Definition: pdfread.cxx:119
bool importPdfVectorGraphicData(SvStream &rStream, std::shared_ptr< VectorGraphicData > &rVectorGraphicData)
Imports a PDF stream as a VectorGraphicData.
Definition: pdfread.cxx:213
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
pdf::PDFAnnotationSubType meSubType
Definition: pdfread.hxx:55
basegfx::B2DRectangle maRectangle
Definition: pdfread.hxx:50
const Size & GetSize() const
Definition: pdfread.hxx:77
const Graphic & GetGraphic() const
Definition: pdfread.hxx:76
css::util::DateTime maDateTime
Definition: pdfread.hxx:51
PDFGraphicResult(Graphic aGraphic, Size const &rSize, std::vector< PDFGraphicAnnotation > aAnnotations)
Definition: pdfread.hxx:68
std::vector< PDFGraphicAnnotation > maAnnotations
Definition: pdfread.hxx:65
size_t ImportPDFUnloaded(const OUString &rURL, std::vector< PDFGraphicResult > &rGraphics)
Import PDF as Graphic images (1 per page), but not loaded yet.
Definition: pdfread.cxx:416
bool ImportPDF(SvStream &rStream, Graphic &rGraphic)
Imports a PDF stream into rGraphic.
Definition: pdfread.cxx:229
const std::vector< PDFGraphicAnnotation > & GetAnnotations() const
Definition: pdfread.hxx:78
std::shared_ptr< pdf::PDFAnnotationMarker > mpMarker
Definition: pdfread.hxx:56