9#include <podofo/auxiliary/InputDevice.h>
10#include "PdfStatefulEncrypt.h"
18enum class PdfPostScriptLanguageLevel : uint8_t
32struct PODOFO_API PdfTokenizerParams final
34 PdfPostScriptLanguageLevel LanguageLevel = PdfPostScriptLanguageLevel::L2;
35 PdfTokenizerFlags Flags = PdfTokenizerFlags::None;
41 PdfPostScriptLanguageLevel LanguageLevel = PdfPostScriptLanguageLevel::L2;
42 bool ReadReferences =
true;
48 friend class PdfParser;
53 static constexpr unsigned BufferSize = 4096;
54 static constexpr size_t MaxStringLength = 64 * 1024 * 1024;
60 [[deprecated(
"Use the overloads with PdfTokenizerParams instead")]]
63 [[deprecated(
"Use the overloads with PdfTokenizerParams instead")]]
116 void SetParameters(
const PdfTokenizerParams& params) { m_Params = params; }
118 const PdfTokenizerParams& GetParameters()
const {
return m_Params; }
125 enum class PdfLiteralDataType : uint8_t
175 void EnqueueToken(
const std::string_view&
token, PdfTokenType
type);
256 using TokenizerPair = std::pair<std::string, PdfTokenType>;
257 using TokenizerQueue = std::deque<TokenizerPair>;
260 std::shared_ptr<charbuff> m_buffer;
261 PdfTokenizerParams m_Params;
262 TokenizerQueue m_tokenQueue;
This file should be included as the FIRST file in every header of PoDoFo lib.
This class is a parser for general PostScript content in PDF documents.
Definition PdfPostScriptTokenizer.h:25
A simple tokenizer for PDF files and PDF content streams.
Definition PdfTokenizer.h:47
bool TryReadNextToken(InputStreamDevice &device, std::string_view &token)
Reads the next token from the current file position ignoring all comments.
bool TryPeekNextToken(InputStreamDevice &device, std::string_view &token)
Try peek the next token from the current file position ignoring all comments, without actually consum...
void ReadNextVariant(InputStreamDevice &device, const std::string_view &token, PdfTokenType tokenType, PdfVariant &variant, const PdfStatefulEncrypt *encrypt)
Read the next variant from the current file position ignoring all comments.
A variant data type which supports all data types supported by the PDF standard.
Definition PdfVariant.h:29
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:30
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13
PdfTokenizerFlags
Definition PdfTokenizer.h:25
@ SkipReferences
Don't read indirect references in the form "1 0 R".
@ String
String datatype in PDF file. Strings have the form (Hallo World!) in PDF files.
@ Dictionary
A dictionary associates keys with values. A key can have another dictionary as value.
@ Array
An array of other PDF data types.
@ Name
Name datatype. Names are used as keys in dictionary to reference values.
@ Reference
The reference datatype contains references to PDF objects in the PDF file of the form 4 0 R.
@ Real
Real datatype for floating point numbers.
@ Number
Number datatype for integer values.
@ Null
The null datatype is always null.
@ Bool
Boolean datatype: Accepts the values "true" and "false".
PdfErrorCode
Error Code enum values which are used in PdfError to describe the error.
Definition PdfError.h:22
@ StrictParsing
Load object streams immediately after parsing cross references sections.
@ None
Do not add a default appearance.
Definition PdfTokenizer.h:40
Definition PdfTokenizer.h:143
bool Strict
PdfTokenizerFlags::StrictParsing at the time of the entry-point call so internal paths can react to s...
Definition PdfTokenizer.h:151
bool ThrowOnError
If set, malformed content raises an exception in the current call.
Definition PdfTokenizer.h:147