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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 PDF_GetPageText_Unicode(wlines, pDoc, pPage, iMinWidth, flags); | 784 PDF_GetPageText_Unicode(wlines, pDoc, pPage, iMinWidth, flags); |
785 for (int i = 0; i < wlines.GetSize(); i++) { | 785 for (int i = 0; i < wlines.GetSize(); i++) { |
786 CFX_WideString wstr = wlines[i]; | 786 CFX_WideString wstr = wlines[i]; |
787 CFX_ByteString str; | 787 CFX_ByteString str; |
788 for (int c = 0; c < wstr.GetLength(); c++) { | 788 for (int c = 0; c < wstr.GetLength(); c++) { |
789 str += CharFromUnicodeAlt(wstr[c], FXSYS_GetACP(), "?"); | 789 str += CharFromUnicodeAlt(wstr[c], FXSYS_GetACP(), "?"); |
790 } | 790 } |
791 lines.Add(str); | 791 lines.Add(str); |
792 } | 792 } |
793 } | 793 } |
794 extern void _PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, | |
795 CPDF_PageObjects* pPage, | |
796 FX_BOOL bUseLF, | |
797 CFX_PtrArray* pObjArray); | |
798 void PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, | 794 void PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, |
799 CPDF_Document* pDoc, | 795 CPDF_Document* pDoc, |
800 CPDF_Dictionary* pPage, | 796 CPDF_Dictionary* pPage, |
801 FX_DWORD flags) { | 797 FX_DWORD flags) { |
802 buffer.EstimateSize(0, 10240); | 798 buffer.EstimateSize(0, 10240); |
803 CPDF_Page page; | 799 CPDF_Page page; |
804 page.Load(pDoc, pPage); | 800 page.Load(pDoc, pPage); |
805 CPDF_ParseOptions options; | 801 CPDF_ParseOptions options; |
806 options.m_bTextOnly = TRUE; | 802 options.m_bTextOnly = TRUE; |
807 options.m_bSeparateForm = FALSE; | 803 options.m_bSeparateForm = FALSE; |
808 page.ParseContent(&options); | 804 page.ParseContent(&options); |
809 _PDF_GetTextStream_Unicode(buffer, &page, TRUE, NULL); | 805 GetTextStream_Unicode(buffer, &page, TRUE, NULL); |
810 } | 806 } |
OLD | NEW |