create the api for the display list
This commit is contained in:
@@ -428,7 +428,14 @@ PYBIND11_MODULE(pdfengine, m) {
|
||||
.def("page_to_device", &pdfengine::PdfPage::pageToDevice,
|
||||
py::arg("page_point"), py::arg("device_width"), py::arg("device_height"), py::arg("rotate") = 0)
|
||||
.def("device_to_page", &pdfengine::PdfPage::deviceToPage,
|
||||
py::arg("device_point"), py::arg("device_width"), py::arg("device_height"), py::arg("rotate") = 0);
|
||||
py::arg("device_point"), py::arg("device_width"), py::arg("device_height"), py::arg("rotate") = 0)
|
||||
.def("extract_display_list", [](const pdfengine::PdfPage& self) {
|
||||
return get_or_throw(self.extractDisplayListJson());
|
||||
})
|
||||
.def("extract_image_xobject", [](const pdfengine::PdfPage& self, const std::string& name) {
|
||||
auto res = get_or_throw(self.extractImageXObject(name));
|
||||
return py::bytes(reinterpret_cast<const char*>(res.data()), res.size());
|
||||
}, py::arg("name"));
|
||||
|
||||
py::class_<pdfengine::PdfDocument, std::shared_ptr<pdfengine::PdfDocument>>(m, "PdfDocument")
|
||||
.def_static("load_from_file", [](const std::string& path, const std::string& password) {
|
||||
|
||||
Reference in New Issue
Block a user