Question
Unable Export Indesign document to RTF format
PMString inrtfPath1("C:\\exind1.rtf") ;<br />IDFile inrtfpath(inrtfPath1) ;<br />InterfacePtr<IK2ServiceRegistry> theRegistry(gSession, UseDefaultIID());<br /> ASSERT_MSG(theRegistry != nil, "Could not get IK2ServiceRegistry from session");<br /><br /> for(int32 iProvider = 0; iProvider < theRegistry->GetServiceProviderCount(kExportProviderService); ++iProvider)<br /> {<br /> // Get the service provider boss class<br /> InterfacePtr<IK2ServiceProvider> theProvider(theRegistry->QueryNthServiceProvider(kExportProviderService, iProvider));<br /> ASSERT_MSG(theProvider != nil, "Could not get IK2ServiceProvider from list");<br /><br /> InterfacePtr<IExportProvider> theExportProvider(theProvider, IID_IEXPORTPROVIDER);<br /> ASSERT_MSG(theExportProvider != nil, "Could not get IExportProvider from service provider");<br /><br /> IActiveContext* theContext = gSession->GetActiveContext();<br /> if(theExportProvider->CanExportThisFormat(doc, theContext->GetContextSelection(),"Rich Text Format" /*"Sangam Rtf Export" <br />//))// "HTML"))// "Adobe PDF"*/))<br /> {<br /> // Create a PDF from the document<br /> CAlert::InformationAlert("can export");<br /> theExportProvider->ExportToFile(FileUtils::PMStringToSysFile(inrtfPath1), doc, theContext->GetContextSelection(),"Sangam Rtf Export" /<br />/*"Adobe PDF"*/, kSuppressUI);//kSuppressUI);<br /> }<br /> }<br /><br />I tried using "Rich Text Format" , "RTF" and "Sangam Rtf Export" but CanExportThisFormat fails.<br />Export file create .rtf file with 0 size without containing any data.<br /><br />With above code I am able to Export document as Adobe Pdf only other formats like TEXT , XML , HTML, RTF are failed.<br /><br />Please give some solution to