OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../include/fpdfapi/fpdf_pageobj.h" | 7 #include "../../include/fpdfapi/fpdf_pageobj.h" |
8 #include "../../include/fpdftext/fpdf_text.h" | 8 #include "../../include/fpdftext/fpdf_text.h" |
9 #include "../../include/fpdfapi/fpdf_page.h" | 9 #include "../../include/fpdfapi/fpdf_page.h" |
10 class CPDF_TextStream : public CFX_Object | 10 class CPDF_TextStream : public CFX_Object |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 return 1; | 129 return 1; |
130 } | 130 } |
131 } | 131 } |
132 if(last_pos + last_width > x + this_width && curChar == L' ') { | 132 if(last_pos + last_width > x + this_width && curChar == L' ') { |
133 return 3; | 133 return 3; |
134 } | 134 } |
135 return 0; | 135 return 0; |
136 } | 136 } |
137 FX_BOOL CPDF_TextStream::ProcessObject(const CPDF_TextObject* pObj, FX_BOOL bFir
stLine) | 137 FX_BOOL CPDF_TextStream::ProcessObject(const CPDF_TextObject* pObj, FX_BOOL bFir
stLine) |
138 { | 138 { |
139 if(pObj->m_Bottom > 380 && pObj->m_Left < 45 && pObj->m_Top < 402) { | |
140 int i = 0; | |
141 } | |
142 CPDF_Font* pFont = pObj->GetFont(); | 139 CPDF_Font* pFont = pObj->GetFont(); |
143 CFX_AffineMatrix matrix; | 140 CFX_AffineMatrix matrix; |
144 pObj->GetTextMatrix(&matrix); | 141 pObj->GetTextMatrix(&matrix); |
145 FX_FLOAT fs = pObj->GetFontSize(); | |
146 int item_index = 0; | 142 int item_index = 0; |
147 if (m_pLastObj) { | 143 if (m_pLastObj) { |
148 int result = FPDFText_ProcessInterObj(m_pLastObj, pObj); | 144 int result = FPDFText_ProcessInterObj(m_pLastObj, pObj); |
149 if (result == 2) { | 145 if (result == 2) { |
150 int len = m_Buffer.GetLength(); | 146 int len = m_Buffer.GetLength(); |
151 if (len && m_bUseLF && m_Buffer.GetBuffer()[len - 1] == L'-') { | 147 if (len && m_bUseLF && m_Buffer.GetBuffer()[len - 1] == L'-') { |
152 m_Buffer.Delete(len - 1, 1); | 148 m_Buffer.Delete(len - 1, 1); |
153 if (m_pObjArray) { | 149 if (m_pObjArray) { |
154 m_pObjArray->RemoveAt((len - 1) * 2, 2); | 150 m_pObjArray->RemoveAt((len - 1) * 2, 2); |
155 } | 151 } |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 CPDF_PageObject* pObject = page.GetNextObject(pos); | 312 CPDF_PageObject* pObject = page.GetNextObject(pos); |
317 if (pObject->m_Type != PDFPAGE_TEXT) { | 313 if (pObject->m_Type != PDFPAGE_TEXT) { |
318 continue; | 314 continue; |
319 } | 315 } |
320 if (textstream.ProcessObject((CPDF_TextObject*)pObject, TRUE)) { | 316 if (textstream.ProcessObject((CPDF_TextObject*)pObject, TRUE)) { |
321 break; | 317 break; |
322 } | 318 } |
323 } | 319 } |
324 return buffer.GetWideString(); | 320 return buffer.GetWideString(); |
325 } | 321 } |
OLD | NEW |