content ad the frontend

This commit is contained in:
saqib mir
2026-06-16 19:27:32 +05:30
parent 7cd400e62a
commit 20ee7fbe20
8 changed files with 266 additions and 21 deletions
+3 -2
View File
@@ -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;