| 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 <cctype> | 7 #include <cctype> |
| 8 #include <cwctype> | 8 #include <cwctype> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "core/include/fpdfapi/fpdf_page.h" | 11 #include "core/include/fpdfapi/fpdf_page.h" |
| 12 #include "core/include/fpdfapi/fpdf_pageobj.h" | 12 #include "core/include/fpdfapi/fpdf_pageobj.h" |
| 13 #include "core/include/fpdfapi/fpdf_resource.h" | 13 #include "core/include/fpdfapi/fpdf_resource.h" |
| 14 #include "core/include/fpdftext/fpdf_text.h" | 14 #include "core/include/fpdftext/fpdf_text.h" |
| 15 #include "core/include/fxcrt/fx_bidi.h" | 15 #include "core/include/fxcrt/fx_bidi.h" |
| 16 #include "core/include/fxcrt/fx_ucd.h" | 16 #include "core/include/fxcrt/fx_ucd.h" |
| 17 #include "text_int.h" | 17 #include "core/src/fpdftext/text_int.h" |
| 18 #include "txtproc.h" | 18 #include "core/src/fpdftext/txtproc.h" |
| 19 | 19 |
| 20 CFX_ByteString CharFromUnicodeAlt(FX_WCHAR unicode, | 20 CFX_ByteString CharFromUnicodeAlt(FX_WCHAR unicode, |
| 21 int destcp, | 21 int destcp, |
| 22 const FX_CHAR* defchar) { | 22 const FX_CHAR* defchar) { |
| 23 if (destcp == 0) { | 23 if (destcp == 0) { |
| 24 if (unicode < 0x80) { | 24 if (unicode < 0x80) { |
| 25 return CFX_ByteString((char)unicode); | 25 return CFX_ByteString((char)unicode); |
| 26 } | 26 } |
| 27 const FX_CHAR* altstr = FCS_GetAltStr(unicode); | 27 const FX_CHAR* altstr = FCS_GetAltStr(unicode); |
| 28 return CFX_ByteString(altstr ? altstr : defchar); | 28 return CFX_ByteString(altstr ? altstr : defchar); |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 CPDF_Document* pDoc, | 778 CPDF_Document* pDoc, |
| 779 CPDF_Dictionary* pPage, | 779 CPDF_Dictionary* pPage, |
| 780 FX_DWORD flags) { | 780 FX_DWORD flags) { |
| 781 buffer.EstimateSize(0, 10240); | 781 buffer.EstimateSize(0, 10240); |
| 782 CPDF_Page page; | 782 CPDF_Page page; |
| 783 page.Load(pDoc, pPage); | 783 page.Load(pDoc, pPage); |
| 784 CPDF_ParseOptions options; | 784 CPDF_ParseOptions options; |
| 785 options.m_bTextOnly = TRUE; | 785 options.m_bTextOnly = TRUE; |
| 786 options.m_bSeparateForm = FALSE; | 786 options.m_bSeparateForm = FALSE; |
| 787 page.ParseContent(&options); | 787 page.ParseContent(&options); |
| 788 GetTextStream_Unicode(buffer, &page, TRUE, NULL); | 788 GetTextStream_Unicode(buffer, &page, TRUE); |
| 789 } | 789 } |
| OLD | NEW |