1
正如標題所說,我想檢索PDF頁面內圖像的所有座標。我現在嘗試,直到爲:MuPDF從pdf頁面獲取每個圖像座標
dev = fz_new_text_device(ctx, sheet, page);
fz_disable_device_hints(dev , FZ_IGNORE_IMAGE);
fz_run_page(doc, pg->currentPage, dev , &ctm,
NULL);
// iterate over the page_blocks (can be image and text);
fz_page_block *block;
for (block = page->blocks;
block < page->blocks + page->len; block++) {
if (block->type == FZ_PAGE_BLOCK_IMAGE) {
fz_image_block *iBlock = block->u.image;
fz_irect iRect;
fz_irect_from_rect(&iRect, &iBlock->bbox);
// the resulting irect from here has x0 = 0 and also
// y0 = 0 even if there are no images aligned in [0,0]
}
}
所以我的問題是,如果我開始了這個做了正確的方式,如果沒有能有人給我如何能得到圖像座標一些指點?