PoDoFo  1.0.0-dev
PdfStreamedDocument.h
1 
7 #ifndef PDF_STREAMED_DOCUMENT_H
8 #define PDF_STREAMED_DOCUMENT_H
9 
10 #include "PdfDeclarations.h"
11 
12 #include "PdfDocument.h"
13 #include <podofo/auxiliary/OutputDevice.h>
14 
15 namespace PoDoFo {
16 
17 class PdfImmediateWriter;
18 
49 class PODOFO_API PdfStreamedDocument final : public PdfDocument
50 {
51  friend class PdfImage;
52 
53 public:
67  PdfStreamedDocument(const std::shared_ptr<OutputStreamDevice>& device, PdfVersion version = PdfVersionDefault,
68  const std::shared_ptr<PdfEncrypt>& encrypt = nullptr, PdfSaveOptions opts = PdfSaveOptions::None);
69 
82  PdfStreamedDocument(const std::string_view& filename, PdfVersion version = PdfVersionDefault,
83  const std::shared_ptr<PdfEncrypt>& encrypt = nullptr, PdfSaveOptions opts = PdfSaveOptions::None);
84 
86 
87 public:
88  const PdfEncrypt* GetEncrypt() const override;
89 
90 protected:
91  PdfVersion GetPdfVersion() const override;
92 
93  void SetPdfVersion(PdfVersion version) override;
94 
95 private:
106  void init(PdfVersion version, PdfSaveOptions opts);
107 
108 private:
109  std::shared_ptr<OutputStreamDevice> m_Device;
110  std::unique_ptr<PdfImmediateWriter> m_Writer;
111  std::shared_ptr<PdfEncrypt> m_Encrypt;
112 };
113 
114 };
115 
116 #endif // PDF_STREAMED_DOCUMENT_H
SPDX-FileCopyrightText: (C) 2005 Dominik Seichter domseichter@web.de SPDX-FileCopyrightText: (C) 2020...
PdfDocument is the core interface for working with PDF documents.
Definition: PdfDocument.h:108
A class that is used to encrypt a PDF file and set document permissions on the PDF file.
Definition: PdfEncrypt.h:122
A PdfImage object is needed when ever you want to embed an image file into a PDF document.
Definition: PdfImage.h:44
PdfStreamedDocument is the preferred class for creating new PDF documents.
Definition: PdfStreamedDocument.h:50
PdfStreamedDocument(const std::shared_ptr< OutputStreamDevice > &device, PdfVersion version=PdfVersionDefault, const std::shared_ptr< PdfEncrypt > &encrypt=nullptr, PdfSaveOptions opts=PdfSaveOptions::None)
Create a new PdfStreamedDocument.
PdfStreamedDocument(const std::string_view &filename, PdfVersion version=PdfVersionDefault, const std::shared_ptr< PdfEncrypt > &encrypt=nullptr, PdfSaveOptions opts=PdfSaveOptions::None)
Create a new PdfStreamedDocument.
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition: basetypes.h:16
PdfSaveOptions
Definition: PdfDeclarations.h:440
constexpr PdfVersion PdfVersionDefault
The default PDF Version used by new PDF documents in PoDoFo.
Definition: PdfDeclarations.h:87
PdfVersion
Enum to identify different versions of the PDF file format.
Definition: PdfDeclarations.h:71