[Date Prev][Date Next] [Thread Prev][Thread Next]
[Date Index] [Thread Index] [New search]

FDK: one more question about saving as sgml



Hello,

I have (again) a question about FDK. I want to customize the way
FrameMaker+SGML saves files as a plain SGML file. The customization
involves one part where I want the pathname of a graphics file to be saved
in the file attribute.

The plug-in works like fmtranslator, changing the save as sgml behaviour a
little.

I already got this running on a SUN system, and with help from some of you
also got it compiled on my windows system, but now there is one annoying
function bothering me.

When I try to get the ID of the anchored frame the image is in, using the
current element which is being saved to file, I get an error (FE_BadObjId).
This error should be a result of an incorrect Id i'm using, but the Id
(eventp->fm_elemid) should be valid (at least its valid on my unix system).

If anyone can shed some light onto this I would be very grateful.

Kind regards,
Adrie Berg

------- part of source code -----
SrwErrorT Sw_EventHandler(SwEventT *eventp, SwConvObjT swObj)
{
  StringT imagepath;
  F_ObjHandleT docId, graphicId, frameId;

  /*Check if the right SGML appliaction is being used. */
  if( (CheckSGMLApplication()==APP_IS_COMP) ||
(CheckSGMLApplication()==APP_IS_SPEC)) {
     switch(eventp->evtype) {
        case SW_EVT_GRAPHIC :
            FA_errno = FE_Success;		

            docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);			
            F_Printf(NULL, "[%d],%d,", FA_errno, nummer);

            frameId = F_ApiGetId(docId, eventp->fm_elemid, FP_Object);
/* results in a   FE_BadObjId   , meaning that eventp->fm_elemid is giving
problems  */
            F_Printf(NULL, "[%d]", FA_errno);

            graphicId = F_ApiGetId(docId, frameId, FP_FirstGraphicInFrame);
            F_Printf(NULL, "[%d]", FA_errno);

            WriteSGMLGraphicWithPath( F_ApiGetString(docId, graphicId,
FP_InsetFile) , swObj);
            break;
       default :
            break;
     }
  }	
  return Sw_Convert(eventp, swObj);
}
-------end of source------
--
Daidalos - IT in Publishing
http://www.daidalos.nl



** To unsubscribe, send a message to majordomo@omsys.com **
** with "unsubscribe framers" (no quotes) in the body.   **