1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00
This commit is contained in:
Lu Wang 2013-04-07 17:01:37 +08:00
parent 4a0f422b31
commit 33e9d2d750
2 changed files with 10 additions and 7 deletions

View File

@ -87,17 +87,12 @@ public:
*/
void prepare(void);
double get_ascent (void) const { return ascent; }
double get_descent(void) const { return descent; }
private:
void optimize(void);
const Param & param;
AllStateManager & all_manager;
double x, y;
long long tm_id;
double ascent, descent;
std::vector<State> states;

View File

@ -6,11 +6,14 @@
* Copyright (C) 2013 Lu Wang <coolwanglu@gmail.com>
*/
#include <algorithm>
#include "HTMLTextPage.h"
namespace pdf2htmlEX {
using std::ostream;
using std::unique_ptr;
HTMLTextPage::HTMLTextPage(const Param & param, AllStateManager & all_manager)
: param(param)
@ -71,12 +74,17 @@ void HTMLTextPage::open_new_line(void)
}
}
static bool is_text_line_empty(const unique_ptr<HTMLTextLine>& p)
{
return p->empty();
}
void HTMLTextPage::prepare(void)
{
// remove empty lines
text_lines.erase(remove_if(text_lines.begin(), text_lines.end(), is_text_line_empty), text_lines.end());
for(auto iter = text_lines.begin(); iter != text_lines.end(); ++iter)
{
(*iter)->prepare();
}
if(param.optimize_text)
optimize();
}