[poppler] functions for boxes bounding all text in a page
sgerwk at aol.com
sgerwk at aol.com
Thu Sep 21 14:11:16 UTC 2017
Hi,
I wrote a couple of functions for finding the area used by text in a page; it
returns an number of PopplerRectangle that should enclose all text as strictly
as possible. Another function returns the smallest rectangle covering all text,
like 'gs -sDEVICE=bbox' does in postscript.
The enclosed test program can be run by 'pdfrects file.pdf' and produce a new
pdf file 'result.pdf' with the rectangles drawn in various colors.
They may be used for example for copying text from two-column documents, to
zoom to the area actually used in the page, for creating a new document better
suited for small-screen devices such as tablets, ebook readers and mobile
phones.
If you think such functions may be of general use I may make a patch to
incorporate them in poppler.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20170921/88094cd4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pdfrects.c
Type: text/x-csrc
Size: 15452 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20170921/88094cd4/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 219 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20170921/88094cd4/attachment.obj>
More information about the poppler
mailing list