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 "../../../third_party/base/nonstd_unique_ptr.h" | 7 #include "../../../third_party/base/nonstd_unique_ptr.h" |
8 #include "../../include/fpdfapi/fpdf_page.h" | 8 #include "../../include/fpdfapi/fpdf_page.h" |
9 #include "../../include/fpdfapi/fpdf_pageobj.h" | 9 #include "../../include/fpdfapi/fpdf_pageobj.h" |
10 #include "../../include/fpdfapi/fpdf_resource.h" | 10 #include "../../include/fpdfapi/fpdf_resource.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 char_box.bottom * pText->m_TextState.GetFontSize() / 1000; | 97 char_box.bottom * pText->m_TextState.GetFontSize() / 1000; |
98 cc++; | 98 cc++; |
99 FX_FLOAT char_origx, char_origy; | 99 FX_FLOAT char_origx, char_origy; |
100 matrix.Transform(char_left, 0, char_origx, char_origy); | 100 matrix.Transform(char_left, 0, char_origx, char_origy); |
101 matrix.TransformRect(char_left, char_right, char_top, char_bottom); | 101 matrix.TransformRect(char_left, char_right, char_top, char_bottom); |
102 CFX_ByteString str; | 102 CFX_ByteString str; |
103 pFont->AppendChar(str, charcode); | 103 pFont->AppendChar(str, charcode); |
104 InsertTextBox(NULL, char_origy, char_left, char_right, char_top, | 104 InsertTextBox(NULL, char_origy, char_left, char_right, char_top, |
105 char_bottom, spacew, fontsize_v, str, pFont); | 105 char_bottom, spacew, fontsize_v, str, pFont); |
106 } | 106 } |
107 if (pPosArray) { | |
108 FX_Free(pPosArray); | 107 FX_Free(pPosArray); |
109 } | |
110 return; | 108 return; |
111 } | 109 } |
112 FX_FLOAT ratio_h = fontsize_h / pText->m_TextState.GetFontSize(); | 110 FX_FLOAT ratio_h = fontsize_h / pText->m_TextState.GetFontSize(); |
113 for (int ii = 0; ii < count * 2; ii++) { | 111 for (int ii = 0; ii < count * 2; ii++) { |
114 pPosArray[ii] *= ratio_h; | 112 pPosArray[ii] *= ratio_h; |
115 } | 113 } |
116 FX_FLOAT baseline = pText->m_PosY; | 114 FX_FLOAT baseline = pText->m_PosY; |
117 CTextBaseLine* pBaseLine = NULL; | 115 CTextBaseLine* pBaseLine = NULL; |
118 FX_FLOAT topy = pText->m_Top; | 116 FX_FLOAT topy = pText->m_Top; |
119 FX_FLOAT bottomy = pText->m_Bottom; | 117 FX_FLOAT bottomy = pText->m_Bottom; |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 FX_DWORD flags) { | 793 FX_DWORD flags) { |
796 buffer.EstimateSize(0, 10240); | 794 buffer.EstimateSize(0, 10240); |
797 CPDF_Page page; | 795 CPDF_Page page; |
798 page.Load(pDoc, pPage); | 796 page.Load(pDoc, pPage); |
799 CPDF_ParseOptions options; | 797 CPDF_ParseOptions options; |
800 options.m_bTextOnly = TRUE; | 798 options.m_bTextOnly = TRUE; |
801 options.m_bSeparateForm = FALSE; | 799 options.m_bSeparateForm = FALSE; |
802 page.ParseContent(&options); | 800 page.ParseContent(&options); |
803 _PDF_GetTextStream_Unicode(buffer, &page, TRUE, NULL); | 801 _PDF_GetTextStream_Unicode(buffer, &page, TRUE, NULL); |
804 } | 802 } |
OLD | NEW |