Hi,
I am using a method to Save Frame file as PDF using FDK 11 and this works fine. Currently, I have a requirement to Save the whole Frame book as PDF for which i am trying with the same method but the output is not accurate. The contents in the rendered PDF is cropped to the Top and Right. Tried several options and could not figure out the cause of the issue. any help would be highly appreciated.
Used Method:
long SaveAsPdf(char* strSourceFileName, char* strTargetFileName)
{
F_PropValsT params, *returnParams = NULL;
F_ObjHandleT docId, pgfId, saveId;
IntT i = 0;
StringT name = NULL;
StringT str_Target_File_Name;
long bookId;
str_Target_File_Name = F_StrCopyString((StringT)strTargetFileName);
F_FdeInit();
/* Open all files */
bookId = openBookFiles(strSourceFileName);
/* Get docId in order to set Acrobat Bookmark levels */
docId = F_ApiGetId(FV_SessionId, FV_SessionId, FP_FirstOpenDoc);
/* Sets the save parameters so as to save as PDF and allow user to name file.*/
params = F_ApiGetSaveDefaultParams();
i = F_ApiGetPropIndex(¶ms, FS_FileType);
params.val[i].propVal.u.ival = FV_SaveFmtPdf;
/* Saves the book and all its components to one PDF file */
saveId = F_ApiSave(bookId, str_Target_File_Name, ¶ms, &returnParams);
/* Close the open files.*/
while (docId)
{
F_ApiClose(docId, FF_CLOSE_MODIFIED);
docId = F_ApiGetId(FV_SessionId, FV_SessionId, FP_NextOpenDocInSession);
}
F_ApiDeallocatePropVals(¶ms);
F_ApiDeallocatePropVals(returnParams);
return (long)saveId;
}
long openBookFiles(char* strSourceFileName)
{
IntT i = 0;
F_PropValsT script, *returnp = NULL;
F_ObjHandleT compId;
F_ObjHandleT docId;
StringT compName = NULL;
StringT str_Source_File_Name;
str_Source_File_Name = F_StrCopyString((StringT)strSourceFileName);
/* create open script which minimizes user response*/
script = F_ApiGetOpenDefaultParams();
i = F_ApiGetPropIndex(&script, FS_MakeVisible);
script.val[i].propVal.u.ival = False;
i = F_ApiGetPropIndex(&script, FS_RefFileNotFound);
script.val[i].propVal.u.ival = FV_AllowAllRefFilesUnFindable;
i = F_ApiGetPropIndex(&script, FS_FileIsOldVersion);
script.val[i].propVal.u.ival = FV_DoOK;
i = F_ApiGetPropIndex(&script, FS_FontChangedMetric);
script.val[i].propVal.u.ival = FV_DoOK;
i = F_ApiGetPropIndex(&script, FS_FontNotFoundInCatalog);
script.val[i].propVal.u.ival = FV_DoOK;
i = F_ApiGetPropIndex(&script, FS_FontNotFoundInDoc);
script.val[i].propVal.u.ival = FV_DoOK;
i = F_ApiGetPropIndex(&script, FS_LanguageNotAvailable);
script.val[i].propVal.u.ival = FV_DoOK;
i = F_ApiGetPropIndex(&script, FS_LockCantBeReset);
script.val[i].propVal.u.ival = FV_DoOK;
i = F_ApiGetPropIndex(&script, FS_UpdateTextReferences);
script.val[i].propVal.u.ival = FV_DoNo;
i = F_ApiGetPropIndex(&script, FS_UpdateXRefs);
script.val[i].propVal.u.ival = FV_DoNo;
i = F_ApiGetPropIndex(&script, FS_UseAutoSaveFile);
script.val[i].propVal.u.ival = FV_DoNo;
i = F_ApiGetPropIndex(&script, FS_UseRecoverFile);
script.val[i].propVal.u.ival = FV_DoNo;
i = F_ApiGetPropIndex(&script, FS_AlertUserAboutFailure);
script.val[i].propVal.u.ival = False;
i = F_ApiGetPropIndex(&script, FS_BeefyDoc);
script.val[i].propVal.u.ival = FV_DoOK;
i = F_ApiGetPropIndex(&script, FS_FileIsInUse);
script.val[i].propVal.u.ival = FV_OpenViewOnly;
i = F_ApiGetPropIndex(&script, FS_FileIsStructured);
script.val[i].propVal.u.ival = FV_OpenViewOnly;
i = F_ApiGetPropIndex(&script, FS_OpenFileNotWritable);
script.val[i].propVal.u.ival = FV_DoOK;
long bookId = F_ApiOpen(str_Source_File_Name, &script, &returnp);
F_ApiDeallocatePropVals(&script);
return long(bookId);
}
Added an image with expected and cropped scenario.
![Cropped_Expected.jpg]()