diff --git a/cpp/poppler-page.cpp b/cpp/poppler-page.cpp index a4ebfe5..1dfc9c7 100644 --- a/cpp/poppler-page.cpp +++ b/cpp/poppler-page.cpp @@ -4,6 +4,7 @@ * Copyright (C) 2017, Jason Alan Palmer * Copyright (C) 2018, Suzuki Toshiya * Copyright (C) 2018, Adam Reichold + * Copyright (C) 2018, Zsombor Hollay-Horvath * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -309,6 +310,11 @@ rectf text_box::bbox() const return m_data->bbox; } +int text_box::rotation() const +{ + return m_data->rotation; +} + rectf text_box::char_bbox(size_t i) const { if (i < m_data->char_bboxes.size()) @@ -363,6 +369,7 @@ std::vector page::text_list() const text_box tb{new text_box_data{ ustr, {xMin, yMin, xMax-xMin, yMax-yMin}, + word->getRotation(), {}, word->hasSpaceAfter() == gTrue }}; diff --git a/cpp/poppler-page.h b/cpp/poppler-page.h index 93a13d1..4211a42 100644 --- a/cpp/poppler-page.h +++ b/cpp/poppler-page.h @@ -2,6 +2,7 @@ * Copyright (C) 2009-2010, Pino Toscano * Copyright (C) 2018, Suzuki Toshiya * Copyright (C) 2018, Albert Astals Cid + * Copyright (C) 2018, Zsombor Hollay-Horvath * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,6 +42,7 @@ public: ustring text() const; rectf bbox() const; + int rotation() const; /** Get a bbox for the i-th glyph diff --git a/cpp/poppler-private.h b/cpp/poppler-private.h index 501c4fc..71cf65a 100644 --- a/cpp/poppler-private.h +++ b/cpp/poppler-private.h @@ -6,6 +6,7 @@ * Copyright (C) 2018, Suzuki Toshiya * Copyright (C) 2018, Adam Reichold * Copyright (C) 2018 Albert Astals Cid + * Copyright (C) 2018, Zsombor Hollay-Horvath * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -76,6 +77,7 @@ struct text_box_data ustring text; rectf bbox; + int rotation; std::vector char_bboxes; bool has_space_after; };