1 // Copyright 2016 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef CORE_FPDFAPI_EDIT_CPDF_PAGECONTENTGENERATOR_H_ 8 #define CORE_FPDFAPI_EDIT_CPDF_PAGECONTENTGENERATOR_H_ 9 10 #include <vector> 11 12 #include "core/fxcrt/fx_basic.h" 13 #include "core/fxcrt/fx_system.h" 14 15 class CPDF_Document; 16 class CPDF_ImageObject; 17 class CPDF_Page; 18 class CPDF_PageObject; 19 class CPDF_PathObject; 20 class CPDF_TextObject; 21 22 class CPDF_PageContentGenerator { 23 public: 24 explicit CPDF_PageContentGenerator(CPDF_Page* pPage); 25 ~CPDF_PageContentGenerator(); 26 27 void GenerateContent(); 28 29 private: 30 friend class CPDF_PageContentGeneratorTest; 31 32 void ProcessPath(CFX_ByteTextBuf* buf, CPDF_PathObject* pPathObj); 33 void ProcessImage(CFX_ByteTextBuf* buf, CPDF_ImageObject* pImageObj); 34 void ProcessGraphics(CFX_ByteTextBuf* buf, CPDF_PageObject* pPageObj); 35 void ProcessText(CFX_ByteTextBuf* buf, CPDF_TextObject* pTextObj); 36 CFX_ByteString RealizeResource(uint32_t dwResourceObjNum, 37 const CFX_ByteString& bsType); 38 39 CPDF_Page* const m_pPage; 40 CPDF_Document* const m_pDocument; 41 std::vector<CPDF_PageObject*> m_pageObjects; 42 }; 43 44 #endif // CORE_FPDFAPI_EDIT_CPDF_PAGECONTENTGENERATOR_H_ 45