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