Skip to main content
Inspiring
September 22, 2017
Answered

FormatNames supported by the IExportProvider

  • September 22, 2017
  • 1 reply
  • 775 views

Does someone have the list (or could tell me where to find it) of all the supported formats of the IExportProvider?

I only found the InCopyMarkup and InCopyInterchange but I need the InDesign Markup Language.

I also try

               PMString icDocumentFormatName("InDesign Markup (IDML)");

                PMString icDocumentFormatName3("InDesignMarkup");

                PMString icDocumentFormatName4("InDesignMarkup (IDML)");

                PMString icDocumentFormatName5("InDesignMarkupLanguage");

                PMString icDocumentFormatName6("InDesign Markup Language");

                PMString icDocumentFormatName7("IDML");

                PMString icDocumentFileExtension (f.GetExtensionForFormatName(icDocumentFormatName));

                PMString icDocumentFileExtension3 (f.GetExtensionForFormatName(icDocumentFormatName3));

                PMString icDocumentFileExtension4 (f.GetExtensionForFormatName(icDocumentFormatName4));

                PMString icDocumentFileExtension5 (f.GetExtensionForFormatName(icDocumentFormatName5));

                PMString icDocumentFileExtension6 (f.GetExtensionForFormatName(icDocumentFormatName6));

                PMString icDocumentFileExtension7 (f.GetExtensionForFormatName(icDocumentFormatName7));

but all return an empty string.

This topic has been closed for replies.
Correct answer LucySS_00

Look at Re: IDocFileHandler SaveACopy as idml i have given an working example that works fine with the suppressed UI. Without looking at your code or more information as to what of you mean by not saving at the specified path, its difficult to provide hints that may solve your issue.

-Manan


With more investigation I found What I had wrong

this is the solution that Implemented for this (SDK for CS5 and CS55 because CS6 can be solved with Manan answer):

                 IDocument* frontDoc = Utils<ILayoutUIUtils>()->GetFrontDocument();

                PMString formatName("InDesignMarkup");

               

                InterfacePtr<IK2ServiceRegistry> iK2ServiceRegistry(GetExecutionContextSession(),UseDefaultIID());

               

                if(!iK2ServiceRegistry)

                    return;

              

               //look for all service providers with kExportProviderService

               int32 exportProviderCount = iK2ServiceRegistry->GetServiceProviderCount(kExportProviderService);

               

                //Iterate through them

                bool found = kFalse;

               for (int32 exportProviderIndex = 0; exportProviderIndex < exportProviderCount; exportProviderIndex++) {

                    //get the service provider boss class

                    InterfacePtr<IK2ServiceProvider> iK2ServiceProvider(iK2ServiceRegistry ->QueryNthServiceProvider(kExportProviderService, exportProviderIndex));

                   //get the export provider implementation itself

                    InterfacePtr<IExportProvider> exportProvider (iK2ServiceProvider,IID_IEXPORTPROVIDER);

                   //Check to see if the current selecction specifier can be exporter by this provider

                    bool16 canExportByTarget = exportProvider->CanExportThisFormat(frontDoc, nil, formatName);

                   

                    if (canExportByTarget) {

                       found=kTrue;

                        IDFile dest(WideString("path and name of the new file location.idml"));

                        exportProvider->ExportToFile(dest, frontDoc, nil, formatName, kSuppressUI);

                    }

                  

                   if (found) {

                        break;

                    }

                   

               }

1 reply

Inspiring
September 22, 2017

I am using formatName("InDesignMarkup"), it works fine to export idml file.

LucySS_00Author
Inspiring
September 22, 2017

Hi, I have other question related to the IExportProvider.

When I use the kSuppressUI in the function ExportToFile from IExportProvider the file is not save in the specified path.

I don't want to use the kFullUI option because is an automated process that need to export the file to idml (the kFullUI launch a pop up that request to save the file).

What did you do after the ExportToFile?  Thanks in advance

Inspiring
September 22, 2017

I am using kSuppressUI in IExportProvider::ExportToFile, it works.