Question
IndesingCS2 server scriptable pluign: how to import image file into a frame.?
Hello<br />I am creating a scriptable pluign for indesingcs2 server.<br />Now I am stuck at importing a image file in a image frame on a document.<br />The code which was running fine for indesingcs2 desktop is given below.<br />//////////////////////////////////////////////////////////////////////////////////////////////////<br /> IDFile sysFile = SDKUtilities::PMStringToSysFile(const_cast<PMString* >(&ImageFileNamewithcompletepath)); <br /> InterfacePtr<ICommand> importCmd(CmdUtils::CreateCommand(kImportAndLoadPlaceGunCmdBoss));<br /> if(!importCmd) <br /> return kFalse; <br />InterfacePtr<IImportFileCmdData> importFileCmdData(importCmd, IID_IIMPORTFILECMDDATA); <br /> if(!importFileCmdData)<br /> return kFalse;<br /><br /> <br /><br /> //db is input.I got it using the techniques mentioned in the indesign-server-plugin-techniques.pdf<br /> //page 18..<br /> importFileCmdData->Set(db, sysFile, kMinimalUI);<br /> ErrorCode err = CmdUtils::ProcessCommand(importCmd);<br /> if(err != kSuccess) <br /> return kFalse;<br /><br /> InterfacePtr<IPlaceGun> placeGun(db, db->GetRootUID(), UseDefaultIID());<br /> if(!placeGun)<br /> return kFalse;<br /><br /> <br /> UIDRef placedItem(db, placeGun->GetItemUID());<br /><br /> InterfacePtr<ICommand> replaceCmd(CmdUtils::CreateCommand(kReplaceCmdBoss));<br /> if (replaceCmd == nil)<br /> return kFalse;<br /><br /> InterfacePtr<IReplaceCmdData>iRepData(replaceCmd, IID_IREPLACECMDDATA);<br /> if(!iRepData)<br /> return kFalse;<br /> <br /> iRepData->Set(db, imageBox.GetUID(), placedItem.GetUID(), kFalse);<br /><br /> ErrorCode status = CmdUtils::ProcessCommand(replaceCmd);<br /> if(status==kFailure)<br /> return kFalse;<br /><br /> return kTrue;<br />/////////////////////////////////////////////////////////////////////////////////////////////////<br />I used the same code for making scriptable plugin for indesignCS2 server as it doesn't involve use of any UI element.<br />But this code is not working.It doesn't crash or returns kFalse.<br />What i see after executing the plugin through script is a grey region for image in the graphics frame.<br /><br />I request if anyone gives me solution to this i will be highly grateful to him.<br /><br />Thanks and Regards,<br />Yogesh Joshi
