hwhw/kindlepdfviewer — Issue #35: implement manual page crop
Author: dpavlin
Created: 2012-03-05 18:47:04+00:00
State: open

Some pdf files have bounding boxes totally wrong. djvu doesn't have it at all. Before I started using this reader, I was cropping pdfs manually to provide better experience, but now I can code that in lua :-)

Idea is to provide manual margins (with option to specify different ones for odd and even pages) and use that instead of page:getUsedBBox values. This would make two-column mode and all fit-to-content zoom levels work automatically.

To implement it, I would need a way to draw lines over rendered pdf page. Something like xor 0xff might be perfect, since I could just re-draw line if I move it. I did a quick look in blitbuffer.c, and it seems to me that I need paintRect which will do XOR with value, so I will give my rusty C knowledge a spin.