Can't get graphic import parameters to work
Hi,
I'm trying to import a graphic by reference at a set DPI (222). The following code sample imports the graphic, but ignores the DPI setting. Can anyone see what is wrong? A few notes:
- I wrote an FDK equivalent and it worked fine, following the exact same methodology.
- The GetImportDefaultParams() populates an array of about 45 members and GetPropIndex() retrieves unique indexes, suggesting that those parts are working
- Upon experimentation, I find that parms[index].PropIdent is always undefined, which seems weird.
Thanks.
var doc = app.ActiveDoc;
var tl = new TextLoc();
tl.obj = doc.FirstSelectedGraphicInDoc;
if(!tl.obj.ObjectValid) tl.obj = doc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;
tl.offset = 0;
var parms = GetImportDefaultParams();
index = GetPropIndex (parms, Constants.FS_GraphicDpi);
parms[index].TypedVal = 222;
index = GetPropIndex (parms, Constants.FS_FitGraphicInSelectedRect);
parms[index].TypedVal = false;
var returnParms = new PropVals();
doc.Import(tl, "C:\\temp\\delete\\222_dpi.jpg", parms, returnParms);