10#include "PdfReference.h"
20class PdfDataContainer;
116 std::string_view GetDataTypeString()
const;
124 bool IsNumber()
const;
130 bool IsRealStrict()
const;
134 bool IsNumberOrReal()
const;
138 bool IsString()
const;
146 bool IsArray()
const;
150 bool IsDictionary()
const;
154 bool IsRawData()
const;
162 bool IsReference()
const;
174 bool GetBool()
const;
175 bool TryGetBool(
bool& value)
const;
182 int64_t GetNumberLenient()
const;
183 bool TryGetNumberLenient(
int64_t& value)
const;
191 bool TryGetNumber(
int64_t& value)
const;
198 double GetReal()
const;
199 bool TryGetReal(
double& value)
const;
206 double GetRealStrict()
const;
207 bool TryGetRealStrict(
double& value)
const;
217 const PdfName& GetName()
const;
218 bool TryGetName(
PdfName& name)
const;
219 bool TryGetName(
const PdfName*& name)
const;
249 void SetBool(
bool value);
265 void SetReal(
double value);
273 void SetName(
const PdfName& name);
326 const PdfArray& GetArrayUnsafe()
const;
334 bool tryGetName(
const PdfName*& name)
const;
369 template <
typename T>
373 PrimitiveMember(T value)
378 if (std::is_same_v<T, int64_t>)
379 return PdfDataType::Number;
380 else if (std::is_same_v<T, double>)
381 return PdfDataType::Real;
382 else if (std::is_same_v<T, bool>)
383 return PdfDataType::Bool;
384 else if (std::is_same_v<T, PdfDictionary*>)
385 return PdfDataType::Dictionary;
386 else if (std::is_same_v<T, PdfArray*>)
387 return PdfDataType::Array;
388 else if (std::is_same_v<T, PdfData*>)
389 return PdfDataType::RawData;
391 return PdfDataType::Unknown;
An interface for writing blocks of data to a data source.
Definition OutputStream.h:18
This class represents a PdfArray Use it for all arrays that are written to a PDF file.
Definition PdfArray.h:81
A class to inherit for classes that are stored as union members in a PdfVariant.
Definition PdfBaseDataTypes.h:21
A datatype that allows to write arbitrary data to a PDF file.
Definition PdfData.h:23
The PDF dictionary data type of PoDoFo (inherits from PdfDataContainer, the base class for such repre...
Definition PdfDictionary.h:82
This class represents a PdfName.
Definition PdfName.h:24
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:35
A reference is a pointer to a object in the PDF file of the form "4 0 R", where 4 is the object numbe...
Definition PdfReference.h:24
A string that can be written to a PDF document.
Definition PdfString.h:24
A simple tokenizer for PDF files and PDF content streams.
Definition PdfTokenizer.h:36
A variant data type which supports all data types supported by the PDF standard.
Definition PdfVariant.h:33
PdfString m_String
Holds references, strings, names, dictionaries and arrays.
Definition PdfVariant.h:413
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:38
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition basetypes.h:16
PdfDataType
Every PDF datatype that can occur in a PDF file is referenced by an own enum (e.g.
Definition PdfDeclarations.h:167
@ Null
The null datatype is always null.
PdfWriteFlags
Specify additional options for writing the PDF.
Definition PdfDeclarations.h:149