| 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_page.h" | 7 #include "../../include/fpdfapi/fpdf_page.h" |
| 8 #include "../../include/fpdfapi/fpdf_pageobj.h" | 8 #include "../../include/fpdfapi/fpdf_pageobj.h" |
| 9 #include "../../include/fpdftext/fpdf_text.h" | 9 #include "../../include/fpdftext/fpdf_text.h" |
| 10 #include "txtproc.h" | 10 #include "txtproc.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 pFont->AppendChar(segment, charcode); | 141 pFont->AppendChar(segment, charcode); |
| 142 space_count = 0; | 142 space_count = 0; |
| 143 last_left = char_left; | 143 last_left = char_left; |
| 144 last_right = char_right; | 144 last_right = char_right; |
| 145 } | 145 } |
| 146 if (segment.GetLength()) | 146 if (segment.GetLength()) |
| 147 pBaseLine = InsertTextBox(pBaseLine, baseline, leftx + segment_left, lef
tx + segment_right, | 147 pBaseLine = InsertTextBox(pBaseLine, baseline, leftx + segment_left, lef
tx + segment_right, |
| 148 topy, bottomy, spacew, fontsize_v, segment, pF
ont); | 148 topy, bottomy, spacew, fontsize_v, segment, pF
ont); |
| 149 FX_Free(pPosArray); | 149 FX_Free(pPosArray); |
| 150 } | 150 } |
| 151 static void ConvertPDFString(CFX_ByteString& result, CFX_ByteString& src, CPDF_F
ont* pFont); | |
| 152 CTextBaseLine* CTextPage::InsertTextBox(CTextBaseLine* pBaseLine, FX_FLOAT basey
, FX_FLOAT leftx, | 151 CTextBaseLine* CTextPage::InsertTextBox(CTextBaseLine* pBaseLine, FX_FLOAT basey
, FX_FLOAT leftx, |
| 153 FX_FLOAT rightx, FX_FLOAT topy, FX_FLOAT
bottomy, FX_FLOAT spacew, FX_FLOAT fontsize_v, | 152 FX_FLOAT rightx, FX_FLOAT topy, FX_FLOAT
bottomy, FX_FLOAT spacew, FX_FLOAT fontsize_v, |
| 154 CFX_ByteString& str, CPDF_Font* pFont) | 153 CFX_ByteString& str, CPDF_Font* pFont) |
| 155 { | 154 { |
| 156 if (str.GetLength() == 0) { | 155 if (str.GetLength() == 0) { |
| 157 return NULL; | 156 return NULL; |
| 158 } | 157 } |
| 159 if (pBaseLine == NULL) { | 158 if (pBaseLine == NULL) { |
| 160 int i; | 159 int i; |
| 161 for (i = 0; i < m_BaseLines.GetSize(); i ++) { | 160 for (i = 0; i < m_BaseLines.GetSize(); i ++) { |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 { | 780 { |
| 782 buffer.EstimateSize(0, 10240); | 781 buffer.EstimateSize(0, 10240); |
| 783 CPDF_Page page; | 782 CPDF_Page page; |
| 784 page.Load(pDoc, pPage); | 783 page.Load(pDoc, pPage); |
| 785 CPDF_ParseOptions options; | 784 CPDF_ParseOptions options; |
| 786 options.m_bTextOnly = TRUE; | 785 options.m_bTextOnly = TRUE; |
| 787 options.m_bSeparateForm = FALSE; | 786 options.m_bSeparateForm = FALSE; |
| 788 page.ParseContent(&options); | 787 page.ParseContent(&options); |
| 789 _PDF_GetTextStream_Unicode(buffer, &page, TRUE, NULL); | 788 _PDF_GetTextStream_Unicode(buffer, &page, TRUE, NULL); |
| 790 } | 789 } |
| OLD | NEW |