10#include "PdfReference.h"
20class PdfDataContainer;
38 friend class PdfParser;
117 std::string_view GetDataTypeString()
const;
125 bool IsNumber()
const;
131 bool IsRealStrict()
const;
135 bool IsNumberOrReal()
const;
139 bool IsString()
const;
147 bool IsArray()
const;
151 bool IsDictionary()
const;
155 bool IsRawData()
const;
163 bool IsReference()
const;
175 bool GetBool()
const;
176 bool TryGetBool(
bool& value)
const;
183 int64_t GetNumberLenient()
const;
184 bool TryGetNumberLenient(
int64_t& value)
const;
192 bool TryGetNumber(
int64_t& value)
const;
199 double GetReal()
const;
200 bool TryGetReal(
double& value)
const;
207 double GetRealStrict()
const;
208 bool TryGetRealStrict(
double& value)
const;
218 const PdfName& GetName()
const;
250 void SetBool(
bool value);
266 void SetReal(
double value);
327 const PdfArray& GetArrayUnsafe()
const;
370 template <
typename T>
374 PrimitiveMember(T value)
379 if (std::is_same_v<T, int64_t>)
380 return PdfDataType::Number;
381 else if (std::is_same_v<T, double>)
382 return PdfDataType::Real;
383 else if (std::is_same_v<T, bool>)
384 return PdfDataType::Bool;
385 else if (std::is_same_v<T, PdfDictionary*>)
386 return PdfDataType::Dictionary;
387 else if (std::is_same_v<T, PdfArray*>)
388 return PdfDataType::Array;
389 else if (std::is_same_v<T, PdfData*>)
390 return PdfDataType::RawData;
392 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:414
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