fix: reworked ui components

This commit is contained in:
Furqan-14
2026-06-10 21:51:43 +05:30
parent 5f5c09eaa9
commit fa35589f81
12 changed files with 378 additions and 25 deletions
+12
View File
@@ -234,6 +234,18 @@ PYBIND11_MODULE(pdfengine, m) {
}, py::arg("data"), py::arg("password") = "")
.def_property_readonly("page_count", &pdfengine::PdfDocument::pageCount)
.def_property_readonly("metadata", &pdfengine::PdfDocument::metadata)
.def("extract_outline", [](const pdfengine::PdfDocument& self) {
auto res = get_or_throw(self.extractOutline());
py::list out;
for (const auto& item : res) {
py::dict d;
d["title"] = item.title;
d["pageIndex"] = item.pageIndex;
d["level"] = item.level;
out.append(d);
}
return out;
})
.def("get_page", [](pdfengine::PdfDocument& self, int pageIndex) {
return get_or_throw(self.getPage(pageIndex));
}, py::arg("page_index"))