I had
to do the same thing, and I was pleased to discover it is possible with PDFNet.
There's only one minor problem. I am very rusty at matrix math, which is what
PDFNet uses, instead of a coordinate system. Once I got over that hump, it was
simple. I'm using the python bindings, which may or may not apply in your case.
This function checks to see if any part of a text element is near the right edge
of a page. I'm using a hard coded number, but that could easily be changed for
your use case.
def
edgeCheck(element):
"""Check if position is on right edge, True if
not."""
itr = element.GetCharIterator()
text_mtx =
element.GetTextMatrix()
while itr.HasNext():
pt =
Point()
pt.x = itr.Current().x
pt.y =
itr.Current().y
ctm = element.GetCTM()
# To get the absolute character positioning information
concatenate current
# text matrix with CTM and then multiply
relative positioning coordinates with
# the resulting
matrix.
mtx = ctm *
text_mtx
mtx.Mult(pt)
if pt.x >
550:
return False
itr.Next()
return
True
Hmm,
the spacing is a little off, but that's the gist of it.
Spencer Rathbun