Copy link to clipboard
Copied
Hi,
I have using the below code to align the math equation to baseline. It was worked but now i am getting issue in that. Its not align correctly to baseline for one file.
Code:
var sel = app.selection[0];
AlignEqn(sel);
function AlignEqn(obj)
{
if(obj != null)
{
var fp = obj.graphics[0].itemLink.filePath;
var f = File(fp);
f.open('r');
var fs = f.read();
f.close();
var baseline = fs.match(/%%Baseline:\s+(\S+)/)[1];
obj.anchoredObjectSettings.anchorYoffset = -Number(baseline)+"pt";
alert("baseline " + baseline)
}
}
When I place the equation in InDesign its working. If I edit the equation or without any changes and save the equation again in MathType, the above code is not working. When i searching this, i opened both images in textedit, baseline value of those file is getting vary. For your Ref.
Before Save As the Image:
After Save the Image:
Baseline of the image is getting vary after save the image. How can I align the equation to its baseline??
Copy link to clipboard
Copied
Hi,
Sorry... Its version issue..