.fm to .xml conversion using VC++
How to Convert .fm files to xml when i try for this its saying me with some "cannot initialize apiclient error" and also Stdafx.h precomplied error.. thanks in advance
Xml Conversion Using Fdk
Hi Freinds... i need to create an API which converts the .fm file to Xml using Fdk7.2...(C++) the code follows here /*Open an XML File This opens an XML file. In FrameMaker 7.0, the XML file opens as an FM file, but in FrameMaker 7.1 and above, is opens as XML and the file is locked on disk. */ #include "fapi.h" VoidT openXML () { F_PropValsT params, *returnParamsp = NULL; IntT i; params = F_ApiGetOpenDefaultParams(); if (params.len == 0) { F_Printf(NULL, (StringT)"File not opened.Unable to allocate memory.\n"); return; } i = F_ApiGetPropIndex(¶ms, FS_OpenAsType); params.val[i].propVal.u.ival = FV_TYPE_XML; i = F_ApiGetPropIndex(¶ms, FS_ShowBrowser); params.val[i].propVal.u.ival = True; i = F_ApiGetPropIndex(¶ms, FS_StructuredOpenApplication); params.val[i].propVal.u.sval = F_StrCopyString((StringT) "XDocBook"); if (!(F_ApiOpen("", ¶ms, &returnParamsp))) { F_ApiAlert("Couldn't open file.\n", FF_ALERT_CONTINUE_NOTE); F_ApiDeallocatePropVals(¶ms); F_ApiDeallocatePropVals(returnParamsp); return; } else { /* Deallocate property lists*/ F_ApiDeallocatePropVals(¶ms); F_ApiDeallocatePropVals(returnParamsp); return; } } /*Save an XML File This saves the active document to the file sample.xml. In FrameMaker 7.0, the active FM document is saved to disk as sample.xml, keeping the FM document active. In FrameMaker 7.1 and above, the open XML document is saved to sample.xml, making sample.xml the active document. */ VoidT saveXML () { F_PropValsT params, *returnParamsp = NULL; IntT i; F_ObjHandleT docId = F_ApiGetId(0,0,FP_ActiveDoc); /* Get default save properties. Return if it can't be allocated. */ params = F_ApiGetSaveDefaultParams(); if (params.len == 0) { F_Printf(NULL, (StringT)"Couldn't get save parameters!\n"); return; } /*Specify XML as file type to save*/ i = F_ApiGetPropIndex(¶ms, FS_FileType); params.val[i].propVal.u.ival = FV_SaveFmtXml; /* Specify the XML application to be used when saving the document.*/ i = F_ApiGetPropIndex(¶ms, FS_StructuredSaveApplication); params.val[i].propVal.u.sval = F_StrCopyString((StringT) "XDocBook"); if (!(F_ApiSave(docId, "sample.xml", ¶ms, &returnParamsp))) { F_ApiAlert("Couldn't save file.\n", FF_ALERT_CONTINUE_NOTE); /* Deallocate property lists*/ F_ApiDeallocatePropVals(¶ms); F_ApiDeallocatePropVals(returnParamsp); return; } else { /*Deallocate property lists*/ F_ApiDeallocatePropVals(¶ms); F_ApiDeallocatePropVals(returnParamsp); return; } } its leading to errors... is there any other way to do it using *FRAMESCRIPT or MIF??? But in m y company they want me to convert using fdk Help me.. Thanks in Advance.. *
Re: .fm to .xml conversion using VC++
How to Convert .fm files to xml when i try for this its saying me with some "cannot initialize apiclient error" and also Stdafx.h precomplied error.. thanks in advance ___ You are currently subscribed to Framers as [EMAIL PROTECTED] Send list messages to [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] or visit http://lists.frameusers.com/mailman/options/framers/archive%40mail-archive.com Send administrative questions to [EMAIL PROTECTED] Visit http://www.frameusers.com/ for more resources and info.
Xml Conversion Using Fdk
Hi Freinds... i need to create an API which converts the .fm file to Xml using Fdk7.2...(C++) the code follows here /*Open an XML File This opens an XML file. In FrameMaker 7.0, the XML file opens as an FM file, but in FrameMaker 7.1 and above, is opens as XML and the file is locked on disk. */ #include "fapi.h" VoidT openXML () { F_PropValsT params, *returnParamsp = NULL; IntT i; params = F_ApiGetOpenDefaultParams(); if (params.len == 0) { F_Printf(NULL, (StringT)"File not opened.Unable to allocate memory.\n"); return; } i = F_ApiGetPropIndex(¶ms, FS_OpenAsType); params.val[i].propVal.u.ival = FV_TYPE_XML; i = F_ApiGetPropIndex(¶ms, FS_ShowBrowser); params.val[i].propVal.u.ival = True; i = F_ApiGetPropIndex(¶ms, FS_StructuredOpenApplication); params.val[i].propVal.u.sval = F_StrCopyString((StringT) "XDocBook"); if (!(F_ApiOpen("", ¶ms, &returnParamsp))) { F_ApiAlert("Couldn't open file.\n", FF_ALERT_CONTINUE_NOTE); F_ApiDeallocatePropVals(¶ms); F_ApiDeallocatePropVals(returnParamsp); return; } else { /* Deallocate property lists*/ F_ApiDeallocatePropVals(¶ms); F_ApiDeallocatePropVals(returnParamsp); return; } } /*Save an XML File This saves the active document to the file sample.xml. In FrameMaker 7.0, the active FM document is saved to disk as sample.xml, keeping the FM document active. In FrameMaker 7.1 and above, the open XML document is saved to sample.xml, making sample.xml the active document. */ VoidT saveXML () { F_PropValsT params, *returnParamsp = NULL; IntT i; F_ObjHandleT docId = F_ApiGetId(0,0,FP_ActiveDoc); /* Get default save properties. Return if it can't be allocated. */ params = F_ApiGetSaveDefaultParams(); if (params.len == 0) { F_Printf(NULL, (StringT)"Couldn't get save parameters!\n"); return; } /*Specify XML as file type to save*/ i = F_ApiGetPropIndex(¶ms, FS_FileType); params.val[i].propVal.u.ival = FV_SaveFmtXml; /* Specify the XML application to be used when saving the document.*/ i = F_ApiGetPropIndex(¶ms, FS_StructuredSaveApplication); params.val[i].propVal.u.sval = F_StrCopyString((StringT) "XDocBook"); if (!(F_ApiSave(docId, "sample.xml", ¶ms, &returnParamsp))) { F_ApiAlert("Couldn't save file.\n", FF_ALERT_CONTINUE_NOTE); /* Deallocate property lists*/ F_ApiDeallocatePropVals(¶ms); F_ApiDeallocatePropVals(returnParamsp); return; } else { /*Deallocate property lists*/ F_ApiDeallocatePropVals(¶ms); F_ApiDeallocatePropVals(returnParamsp); return; } } its leading to errors... is there any other way to do it using *FRAMESCRIPT or MIF??? But in m y company they want me to convert using fdk Help me.. Thanks in Advance.. * ___ You are currently subscribed to Framers as [EMAIL PROTECTED] Send list messages to [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] or visit http://lists.frameusers.com/mailman/options/framers/archive%40mail-archive.com Send administrative questions to [EMAIL PROTECTED] Visit http://www.frameusers.com/ for more resources and info.