fix: reworked ui components
This commit is contained in:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user