feat: implemented reflow for bullets and single lines along with the fix for save on delay
This commit is contained in:
@@ -202,6 +202,13 @@ PYBIND11_MODULE(pdfengine, m) {
|
||||
.def("render", [](const pdfengine::PdfPage& self, int dpi) {
|
||||
return get_or_throw(self.render(dpi));
|
||||
}, py::arg("dpi") = 96)
|
||||
.def("render_region_raw", [](const pdfengine::PdfPage& self, int dpi, double y_top_pt, double height_pt) {
|
||||
// Returns (width, height, raw RGBA bytes) of the band [y_top_pt, y_top_pt+height_pt]
|
||||
// (points from page top); height_pt<=0 → to page bottom. No PNG. For preview/perf tests.
|
||||
auto img = get_or_throw(self.renderRegionRaw(dpi, y_top_pt, height_pt));
|
||||
return py::make_tuple(img.width, img.height,
|
||||
py::bytes(reinterpret_cast<const char*>(img.data.data()), img.data.size()));
|
||||
}, py::arg("dpi"), py::arg("y_top_pt"), py::arg("height_pt") = 0.0)
|
||||
.def("extract_document_model", [](const pdfengine::PdfPage& self) {
|
||||
return get_or_throw(self.extractDocumentModel());
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user