Copy link to clipboard
Copied
| hi | 12: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. |
.
Copy link to clipboard
Copied
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
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more