Skip to main content
Known Participant
February 19, 2009
Question

Unable Export Indesign document to RTF format

  • February 19, 2009
  • 3 replies
  • 988 views
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
This topic has been closed for replies.

3 replies

Inspiring
February 20, 2009
Your targetBoss for ExportToFile() is wrong.
Use ITextTarget or ITextSelectionSuite as targetBoss.
Known Participant
February 20, 2009
When I set ExportToFile() function's last parameter to kFullUI ,
I get one Export JPEG window and
then error :-
"exind1.rtf" is already open by "^2".
You don't have permission to change the file.

After showing this message

one progress bar is shown and after that SVG options window is shown.
then one progress bar is shown and then one window of Adobe Indesign Tagged Text Options is displayed . When I click on Okof this window.

Rtf file is created without containing ant data.

Please give some solution for exporting indesign document to RTF format.

Regards,
Pallavi.
Inspiring
February 20, 2009
I can export as RTF, I am using "Sangam RTF Export".