![]() |
00001 //--------------------------------------------------------------------------------------- 00002 // Copyright (c) 2001-2010 by PDFTron Systems Inc. All Rights Reserved. 00003 // Consult legal.txt regarding legal and license information. 00004 //--------------------------------------------------------------------------------------- 00005 00006 #ifndef H_CPPPDFElementReader 00007 #define H_CPPPDFElementReader 00008 00009 #include <PDF/Page.h> 00010 #include <PDF/Element.h> 00011 #include <PDF/OCG/Context.h> 00012 #include <Common/Iterator.h> 00013 #include <C/PDF/TRN_ElementReader.h> 00014 00015 00016 namespace pdftron { 00017 namespace PDF { 00018 00019 00025 typedef Common::Iterator<int> GSChangesIterator; 00026 00027 00059 class ElementReader 00060 { 00061 public: 00062 00063 ElementReader(); 00064 ~ElementReader(); 00065 00078 void Begin(const Page& page, OCG::Context* ocg_context = 0); 00079 00099 void Begin(SDF::Obj content_stream, SDF::Obj resource_dict = 0, OCG::Context* ocg_context = 0); 00100 00109 Element Next(); 00110 00118 Element Current(); 00119 00132 void FormBegin(); 00133 00158 GState PatternBegin(SDF::Obj pattern, bool inherit_gs = true); 00159 00182 void Type3FontBegin(SDF::Obj glyph_stream, SDF::Obj font, SDF::Obj resource_dict = 0); 00183 00195 bool End(); 00196 00204 GSChangesIterator GetChangesIterator(); 00205 00210 bool IsChanged(GState::GStateAttribute attrib); 00211 00217 void ClearChangeList(); 00218 00228 SDF::Obj GetFont (const char* name); 00229 00233 SDF::Obj GetXObject (const char* name); 00234 00238 SDF::Obj GetShading(const char* name); 00239 00243 SDF::Obj GetColorSpace (const char* name); 00244 00248 SDF::Obj GetPattern (const char* name); 00249 00253 SDF::Obj GetExtGState (const char* name); 00254 00256 ElementReader(TRN_ElementReader impl); 00257 TRN_ElementReader mp_reader; 00259 }; 00260 00261 00262 00263 #include <Impl/ElementReader.inl> 00264 00265 }; // namespace PDF 00266 }; // namespace pdftron 00267 00268 00269 #endif 00270