16#include <wx/dynarray.h>
17#include <wx/filesys.h>
18#include <wx/mstream.h>
34#define REQUIRED_PERMISSIONS 0x0214
37#define TOKEN_COMMENT 1
38#define TOKEN_BOOLEAN 2
42#define TOKEN_START_ARRAY 6
43#define TOKEN_END_ARRAY 7
44#define TOKEN_START_DICTIONARY 8
45#define TOKEN_END_DICTIONARY 9
46#define TOKEN_REFERENCE 10
73 off_t Seek(off_t pos);
85 void BackOnePosition(
int ch);
104 wxMemoryOutputStream* ReadBuffer(
size_t size);
110 off_t GetStartXRef();
117 wxString ReadString(
int size);
123 wxString CheckPdfHeader();
135 void NextValidToken();
141 int GetTokenType()
const;
147 wxString GetStringValue()
const;
153 int GetIntValue()
const;
165 int GetReference()
const;
171 int GetGeneration()
const;
178 static bool IsWhitespace(
int ch);
185 static bool IsDelimiter(
int ch);
192 static bool IsDelimiterOrWhitespace(
int ch);
199 static int GetHex(
int v);
202 wxInputStream* m_inputStream;
204 wxString m_stringValue;
230WX_DECLARE_USER_EXPORTED_OBJARRAY(
wxPdfXRefEntry, wxPdfXRef, WXDLLIMPEXP_PDFDOC);
247 const wxString& password = wxEmptyString);
268 unsigned int GetPageCount()
const;
295 void AppendObject(
int originalObjectId,
int actualObjectId,
wxPdfObject* obj);
302 wxPdfObject* GetPageResources(
unsigned int pageno);
309 void GetContent(
unsigned int pageno, wxArrayPtrVoid& contents);
316 wxPdfArrayDouble* GetPageMediaBox(
unsigned int pageno);
323 wxPdfArrayDouble* GetPageCropBox(
unsigned int pageno);
330 wxPdfArrayDouble* GetPageBleedBox(
unsigned int pageno);
337 wxPdfArrayDouble* GetPageTrimBox(
unsigned int pageno);
344 wxPdfArrayDouble* GetPageArtBox(
unsigned int pageno);
351 int GetPageRotation (
unsigned int pageno);
378 void GetPageContent(
wxPdfObject* contentRef, wxArrayPtrVoid& contents);
381 wxPdfArrayDouble* GetPageBox(
wxPdfDictionary* page,
const wxString& boxIndex);
387 bool ParseDocument();
390 bool SetupDecryptor();
402 bool ParseXRefStream(
int ptr,
bool setTrailer);
429 wxMemoryOutputStream* DecodePredictor(wxMemoryOutputStream* in,
wxPdfObject* dicPar);
436 wxMemoryOutputStream* FlateDecode(wxMemoryOutputStream* osIn);
443 wxMemoryOutputStream* ASCIIHexDecode(wxMemoryOutputStream* osIn);
450 wxMemoryOutputStream* ASCII85Decode(wxMemoryOutputStream* osIn);
457 wxMemoryOutputStream* LZWDecode(wxMemoryOutputStream* osIn);
460 static wxFileSystem* GetFileSystem();
464 void ReserveXRef(
size_t count);
470 wxString m_pdfVersion;
475 wxArrayPtrVoid m_pages;
476 unsigned int m_currentPage;
485 wxPdfObjectMap* m_objectMap;
486 wxPdfObjStmMap* m_objStmCache;
494 static wxFileSystem* ms_fileSystem;
497#define WXPDF_LZW_STRINGTABLE_SIZE 8192
525 bool Decode(wxMemoryInputStream* dataIn, wxMemoryOutputStream* dataOut);
528 void InitializeStringTable();
534 void WriteString(
int code);
541 void AddStringToTable(
int oldCode,
char newString);
544 wxMemoryInputStream* m_dataIn;
545 wxMemoryOutputStream* m_dataOut;
547 wxArrayInt m_stringTable[WXPDF_LZW_STRINGTABLE_SIZE];
556 static int ms_andTable[4];
Class representing an array object. (For internal use only)
Definition: pdfobjects.h:361
Class representing a dictionary object. (For internal use only)
Definition: pdfobjects.h:409
Class representing PDF encryption methods. (For internal use only)
Definition: pdfencrypt.h:30
Class representing a PDF document information dictionary.
Definition: pdfinfo.h:20
Class representing an LZW decoder. (For internal use only)
Definition: pdfparser.h:505
Class representing a queue of objects. (For internal use only)
Definition: pdfobjects.h:542
Class representing a base PDF object. (For internal use only)
Definition: pdfobjects.h:35
Class representing a PDF parser. (For internal use only)
Definition: pdfparser.h:239
void SetUseRawStream(bool useRawStream)
Set flag whether a stream should be decoded or not.
Definition: pdfparser.h:365
bool GetUseRawStream() const
Get flag whether a stream should be decoded or not.
Definition: pdfparser.h:371
wxPdfObjectMap * GetObjectMap()
Get the map of referenced objects.
Definition: pdfparser.h:287
wxPdfObjectQueue * GetObjectQueue()
Get the queue of referenced objects.
Definition: pdfparser.h:281
wxString GetPdfVersion() const
Get PDF version of parsed document.
Definition: pdfparser.h:262
Class representing a stream object. (For internal use only)
Definition: pdfobjects.h:456
Class representing a tokenizer for parsing PDF documents.
Definition: pdfparser.h:57
bool IsHexString() const
Check whether the token is a hexadecimal string.
Definition: pdfparser.h:159
Class representing an XRef entry (for internal use only)
Definition: pdfparser.h:217
int m_gen_ref
Generation number (type 1) or object number of the object stream (type 2)
Definition: pdfparser.h:227
int m_type
Type of XRef entry (0: free, 1: normal, 2: in stream)
Definition: pdfparser.h:225
int m_ofs_idx
Byte offset of object (type 1) or index in object stream (type 2)
Definition: pdfparser.h:226
Definition of array of type double.
Compile time switches for the wxPdfDocument component.
Interfaces of the wxPdfObject classes.