OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium 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 #include "pdf/pdfium/pdfium_page.h" | 5 #include "pdf/pdfium/pdfium_page.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 base::Value* PDFiumPage::GetTextBoxAsValue(double page_height, | 151 base::Value* PDFiumPage::GetTextBoxAsValue(double page_height, |
152 double left, double top, | 152 double left, double top, |
153 double right, double bottom, | 153 double right, double bottom, |
154 int rotation) { | 154 int rotation) { |
155 base::string16 text_utf16; | 155 base::string16 text_utf16; |
156 int char_count = | 156 int char_count = |
157 FPDFText_GetBoundedText(GetTextPage(), left, top, right, bottom, NULL, 0); | 157 FPDFText_GetBoundedText(GetTextPage(), left, top, right, bottom, NULL, 0); |
158 if (char_count > 0) { | 158 if (char_count > 0) { |
159 unsigned short* data = reinterpret_cast<unsigned short*>( | 159 unsigned short* data = reinterpret_cast<unsigned short*>( |
160 WriteInto(&text_utf16, char_count + 1)); | 160 base::WriteInto(&text_utf16, char_count + 1)); |
161 FPDFText_GetBoundedText(GetTextPage(), | 161 FPDFText_GetBoundedText(GetTextPage(), |
162 left, top, right, bottom, | 162 left, top, right, bottom, |
163 data, char_count); | 163 data, char_count); |
164 } | 164 } |
165 std::string text_utf8 = base::UTF16ToUTF8(text_utf16); | 165 std::string text_utf8 = base::UTF16ToUTF8(text_utf16); |
166 | 166 |
167 FPDF_LINK link = FPDFLink_GetLinkAtPoint(GetPage(), left, top); | 167 FPDF_LINK link = FPDFLink_GetLinkAtPoint(GetPage(), left, top); |
168 Area area; | 168 Area area; |
169 std::vector<LinkTarget> targets; | 169 std::vector<LinkTarget> targets; |
170 if (link) { | 170 if (link) { |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 page_->loading_count_--; | 508 page_->loading_count_--; |
509 } | 509 } |
510 | 510 |
511 PDFiumPage::Link::Link() { | 511 PDFiumPage::Link::Link() { |
512 } | 512 } |
513 | 513 |
514 PDFiumPage::Link::~Link() { | 514 PDFiumPage::Link::~Link() { |
515 } | 515 } |
516 | 516 |
517 } // namespace chrome_pdf | 517 } // namespace chrome_pdf |
OLD | NEW |