What I need, is to export text frames as images, using exportFile() method and get the same appearance as in document.
But if I manipulate with textframe a bit, like resize it a bit, the picture I got is not the same size as the selection: it has some margins.
el = TextFrame element
var file = new File(path + "el" + el.id + ".png"); app.pngExportPreferences.exportResolution = 72; app.pngExportPreferences.transparentBackground = true; el.exportFile(ExportFormat.PNG_FORMAT, file);
for example, if I check el.geometricBounds (or visibleBounds, they are the same) it's [64, 104.88, 85, 336], which is ( 231x22 ).
But with exportFile I got png with 231x29 size.
How to get exact image? Or how to match them so I could crop it later automatically?
That worked for me!