Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

facing issue while trying to add folder to book using FDK11

Guest
Jan 01, 2013 Jan 01, 2013
hi12:26 PM
hi, i m facing issue while trying to add folders to a .book. Here's what i have done.
I have created a book

bookName=F_StrCopyString((StringT)"E:\\Createbook\\input\\test.book");
newbookId=F_ApiNewNamedObject(FV_SessionId,FO_Book,bookName);

and added a chapter to it.

StringT chapName=F_StrCopyString((StringT)"E:\\Createbook\\input\\b_cli.fm");
elemId = F_ApiNewSeriesObject(newbookId,FO_BookComponent,0);
F_ApiSetString(newbookId, elemId, FP_Name,chapName);
if(F_StrLen(chapName)) {
F_ApiDeallocateString(&chapName);
}

After adding the chapter , I am calling the following function to create part:

F_ObjHandleT FM_InsertFolderComponentInBook ( F_ObjHandleT bookId, F_ObjHandleT parentId, StringT compName)
{
F_ObjHandleT partId;
F_ElementLocT elemLoc;
IntT fileCount = 1;

if ( !parentId )
parentId = F_ApiGetId ( FV_SessionId, bookId, FP_HighestLevelElement );
elemLoc.parentId = parentId;
elemLoc.childId = 0;
elemLoc.offset = 0;
partId= F_ApiNewBookComponentOfTypeInHierarchy ( bookId, compName, FV_BK_FOLDER, &elemLoc);
return partId;
}


However, part is not getting generated as parentId is comming null. Can anyone please help me create folder component in a .book using FDK11?
I am  facing this issue if i am scripting using FDK11 but in FDK 10,its running fine. Is this an FKD11 library issue or i am missing anything in the code.
Kindly help.

.

TOPICS
Scripting
638
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jan 03, 2013 Jan 03, 2013
LATEST

Hi,

Are you saying that this call returns null:

parentId = F_ApiGetId ( FV_SessionId, bookId, FP_HighestLevelElement );

The only way that could happen is if it is an unstructured book. Is your book structured, with a structure tree, etc?  Also, is it correct that it works with the FDK10 libraries but not FDK11? I didn't quite understand that statement.

Russ

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines