content ad the frontend
This commit is contained in:
@@ -77,7 +77,7 @@ public:
|
||||
if (obj->getType() == pdfengine::ContentObjectType::Text) {
|
||||
auto* textObj = static_cast<pdfengine::TextObject*>(obj.get());
|
||||
py::dict d;
|
||||
d["text"] = textObj->text;
|
||||
d["text"] = py::bytes(textObj->text);
|
||||
d["fontName"] = textObj->fontName;
|
||||
d["fontSize"] = textObj->fontSize;
|
||||
|
||||
@@ -92,7 +92,8 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
bool replace_text_object(int page_index, int object_index, const std::string& new_text, const std::string& dest_path) {
|
||||
bool replace_text_object(int page_index, int object_index, const py::bytes& new_text_bytes, const std::string& dest_path) {
|
||||
std::string new_text = new_text_bytes;
|
||||
pdfengine::qpdf_layer::QpdfExtractor extractor;
|
||||
auto stream = extractor.extractPageStream(filepath_, page_index);
|
||||
if (!stream.has_value()) return false;
|
||||
|
||||
Reference in New Issue
Block a user