Plugins 将文件另存为C++;Adobe InDesign SC6 SDK插件 我正在为Adobe设计SC6SDK的C++插件。 我正在尝试将文件另存为副本。 在InDesign中手动创建了一个文件,该文件已打开

Plugins 将文件另存为C++;Adobe InDesign SC6 SDK插件 我正在为Adobe设计SC6SDK的C++插件。 我正在尝试将文件另存为副本。 在InDesign中手动创建了一个文件,该文件已打开,plugins,adobe,adobe-indesign,Plugins,Adobe,Adobe Indesign,下面代码中的方法docFileHandler->CanSaveACopy(documentUIDRef)返回false 如何检查文档无法保存的原因? 我没有在文档中找到答案,也没有CanSaveAs()方法的源代码 请告诉我 ErrorCode result = kFailure; do { // Save the document to another file. UIDRef documentUIDRef(db, persist->GetUID()); Int

下面代码中的方法docFileHandler->CanSaveACopy(documentUIDRef)返回false

如何检查文档无法保存的原因? 我没有在文档中找到答案,也没有CanSaveAs()方法的源代码

请告诉我

ErrorCode result = kFailure;
do {
    // Save the document to another file.
    UIDRef documentUIDRef(db, persist->GetUID());

    InterfacePtr<IDocFileHandler> docFileHandler(Utils<IDocumentUtils>()->QueryDocFileHandler(documentUIDRef));
    if (!docFileHandler) {
        break;
    }

    std::string urlToCopy("C:\\temp\\test.indd.bak");
    FileId theCopyFileId;
    theCopyFileId.SetFileURL(urlToCopy);

    if(docFileHandler->CanSaveACopy(documentUIDRef) ) {
        docFileHandler->SaveACopy (documentUIDRef, &theCopyFileId);
        result = ErrorUtils::PMGetGlobalErrorCode();

        if (result != kSuccess) {
            break;
        }
    }
} while(false);
ErrorCode结果=kFailure;
做{
//将文档保存到另一个文件。
UIDRef文档UIDRef(db,persist->GetUID());
InterfacePtr docFileHandler(Utils()->QueryDocFileHandler(documentUIDRef));
如果(!docFileHandler){
打破
}
std::字符串urlToCopy(“C:\\temp\\test.indd.bak”);
FileId拷贝文件id;
copyFileId.SetFileURL(urlToCopy);
if(docFileHandler->CanSaveACopy(documentUIDRef)){
docFileHandler->SaveACopy(documentUIDRef和copyfileid);
结果=ErrorUtils::PMGetGlobalErrorCode();
如果(结果!=k成功){
打破
}
}
}while(假);

您的问题不能链接到urlToCopy规范,尤其是尾部的“.bak”?返回false的方法CanSaveACopy()无法获取url。。它只获取对源文档的引用。您的问题不能链接到urlToCopy规范,尤其是尾部的“.bak”?返回false的方法CanSaveACopy()不获取url。。它只获取对原始文档的引用