I'm trying to export PageItems from a page using either their visibleBounds or their geometricBounds. Problem is, regardless of which I use, text with a shadow has issues: the shadow is exported correctly, but the resulting file is higher and wider than visibleBounds / geometricBounds says.
To be clear, if I select the layer in InDesign it tells me it's 150 wide by 200 high. If I check its visibleBounds and geometricBounds properties, I get 150 wide and 200 high - the same as what InDesign says. But if I export the layer to an image using exportFile, the resulting image is 180 wideby 230 high because of all the space left for the drop shadow.
This is causing me all sorts of problems because I need to place the object on my output page at the right position and co-ordinates. Right now, my best fix is to place the text inside a temporary rectangle, then export the rectangle so that it clips the output to the size visibleBounds / geometricBounds was saying. While that at least saves the image to the size InDesign said, it does mean the shadow is cropped.
Is there a fix for this? Am I just doing something dumb wrong?