Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: pdf/pdfium/pdfium_page.h

Issue 1568723002: Improve extraction of accessible text from PDF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_pdf
Patch Set: Fix last-line issue Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pdf/pdfium/pdfium_page.cc » ('j') | pdf/pdfium/pdfium_page.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef PDF_PDFIUM_PDFIUM_PAGE_H_ 5 #ifndef PDF_PDFIUM_PDFIUM_PAGE_H_
6 #define PDF_PDFIUM_PDFIUM_PAGE_H_ 6 #define PDF_PDFIUM_PDFIUM_PAGE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // empty vector otherwise. 99 // empty vector otherwise.
100 std::vector<int> GetLinks(pp::Rect text_area, 100 std::vector<int> GetLinks(pp::Rect text_area,
101 std::vector<LinkTarget>* targets); 101 std::vector<LinkTarget>* targets);
102 // Calculate the locations of any links on the page. 102 // Calculate the locations of any links on the page.
103 void CalculateLinks(); 103 void CalculateLinks();
104 // Returns link type and target associated with a link. Returns 104 // Returns link type and target associated with a link. Returns
105 // NONSELECTABLE_AREA if link detection failed. 105 // NONSELECTABLE_AREA if link detection failed.
106 Area GetLinkTarget(FPDF_LINK link, LinkTarget* target) const; 106 Area GetLinkTarget(FPDF_LINK link, LinkTarget* target) const;
107 // Returns target associated with a destination. 107 // Returns target associated with a destination.
108 Area GetDestinationTarget(FPDF_DEST destination, LinkTarget* target) const; 108 Area GetDestinationTarget(FPDF_DEST destination, LinkTarget* target) const;
109 // Returns the text in the supplied box as a Value Node
110 base::Value* GetTextBoxAsValue(double page_height, double left, double top,
111 double right, double bottom, int rotation);
112 // Helper functions for JSON generation
113 base::Value* CreateTextNode(const std::string& text);
114 base::Value* CreateURLNode(const std::string& text, const std::string& url);
115 109
116 class ScopedLoadCounter { 110 class ScopedLoadCounter {
117 public: 111 public:
118 explicit ScopedLoadCounter(PDFiumPage* page); 112 explicit ScopedLoadCounter(PDFiumPage* page);
119 ~ScopedLoadCounter(); 113 ~ScopedLoadCounter();
120 114
121 private: 115 private:
122 PDFiumPage* const page_; 116 PDFiumPage* const page_;
123 }; 117 };
124 118
(...skipping 13 matching lines...) Expand all
138 int loading_count_; 132 int loading_count_;
139 pp::Rect rect_; 133 pp::Rect rect_;
140 bool calculated_links_; 134 bool calculated_links_;
141 std::vector<Link> links_; 135 std::vector<Link> links_;
142 bool available_; 136 bool available_;
143 }; 137 };
144 138
145 } // namespace chrome_pdf 139 } // namespace chrome_pdf
146 140
147 #endif // PDF_PDFIUM_PDFIUM_PAGE_H_ 141 #endif // PDF_PDFIUM_PDFIUM_PAGE_H_
OLDNEW
« no previous file with comments | « no previous file | pdf/pdfium/pdfium_page.cc » ('j') | pdf/pdfium/pdfium_page.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698