coolwanglu/pdf2htmlEX — pull request #114 by jahewson (2013-04-05 00:15:00+00:00)
Title: Simple text clipping

Here's my attempt at text clipping, using `GfxState::getClipBBox` which returns a rectangle which bounds the clipping path. I simply transform the character positions from text space to device space and check if they fall completely outside of the clipping rectangle. If they do, then an offset is inserted in their place.

This is the simplest possible implementation I could think of. It could be enhanced by detecting partially clipped characters and somehow tagging them as clipped, and then use the CSS `clip` property on them. That'll work for rectangles only, but that's probably 95% of the real use cases.