Hi,
I am developing a Indesign Plugin to export a Indesign document into a HTML file automatically using C++ code. I don't want to open the Export dialog box(File Chooser) or the properies dialog box when exprting to HTML . The plugin should have the functionality to automatically export a file to HTML file in which the file name is a fixed one.
I went though the SDK and came up with this code.
PMString HTMLFormat("HTML");
HTMLFormat.SetTranslatable(kFalse);
IDocument* doc = Utils<ILayoutUIUtils>()->GetFrontDocument();
InterfacePtr<IK2ServiceRegistry> k2ServiceRegistry(GetExecutionContextSession(), UseDefaultIID());
// Look for all service providers with kExportProviderService.
int32 exportProviderCount = k2ServiceRegistry->GetServiceProviderCount(kExportProviderService);
bool found = kFalse;
InterfacePtr<ISelectionManager> selection(Utils<ISelectionUtils>()->QueryActiveSelection());
for (int32 exportProviderIndex = 0 ; exportProviderIndex < exportProviderCount ; exportProviderIndex++)
{
InterfacePtr<IK2ServiceProvider> k2ServiceProvider (k2ServiceRegistry->QueryNthServiceProvider(kExportProviderService,ex portProviderIndex));
InterfacePtr<IExportProvider> exportProvider(k2ServiceProvider,IID_IEXPORTPROVIDER);
exportProvider->ExportToFile(file, doc,selection,"HTML",kFullUI);
}
Is this the right way to acheive the functionality?
If so I want to know how to pass the file name as a String to the ExportToFile() method.
can any one pls help me to solve the issue?