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/fpdftext/fpdf_text.h" | 11 #include "../../include/fpdftext/fpdf_text.h" |
11 #include "../../include/fxcrt/fx_arb.h" | 12 #include "../../include/fxcrt/fx_arb.h" |
12 #include "../../include/fxcrt/fx_ucd.h" | 13 #include "../../include/fxcrt/fx_ucd.h" |
13 #include "text_int.h" | 14 #include "text_int.h" |
14 #include "txtproc.h" | 15 #include "txtproc.h" |
15 | 16 |
16 extern const FX_CHAR* FCS_GetAltStr(FX_WCHAR); | |
17 CFX_ByteString CharFromUnicodeAlt(FX_WCHAR unicode, int destcp, const FX_CHAR* d
efchar) | 17 CFX_ByteString CharFromUnicodeAlt(FX_WCHAR unicode, int destcp, const FX_CHAR* d
efchar) |
18 { | 18 { |
19 if (destcp == 0) { | 19 if (destcp == 0) { |
20 if (unicode < 0x80) { | 20 if (unicode < 0x80) { |
21 return CFX_ByteString((char)unicode); | 21 return CFX_ByteString((char)unicode); |
22 } | 22 } |
23 const FX_CHAR* altstr = FCS_GetAltStr(unicode); | 23 const FX_CHAR* altstr = FCS_GetAltStr(unicode); |
24 if (altstr) { | 24 if (altstr) { |
25 return CFX_ByteString(altstr, -1); | 25 return CFX_ByteString(altstr, -1); |
26 } | 26 } |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 { | 777 { |
778 buffer.EstimateSize(0, 10240); | 778 buffer.EstimateSize(0, 10240); |
779 CPDF_Page page; | 779 CPDF_Page page; |
780 page.Load(pDoc, pPage); | 780 page.Load(pDoc, pPage); |
781 CPDF_ParseOptions options; | 781 CPDF_ParseOptions options; |
782 options.m_bTextOnly = TRUE; | 782 options.m_bTextOnly = TRUE; |
783 options.m_bSeparateForm = FALSE; | 783 options.m_bSeparateForm = FALSE; |
784 page.ParseContent(&options); | 784 page.ParseContent(&options); |
785 _PDF_GetTextStream_Unicode(buffer, &page, TRUE, NULL); | 785 _PDF_GetTextStream_Unicode(buffer, &page, TRUE, NULL); |
786 } | 786 } |
OLD | NEW |