Hi Folks,
In my plug-ins for InDesign CS5/5.5 desktop I'm importing InDesign Tagged Text via the method IImportSuite::DoImport(). The code goes something like this...
InterfacePtr<IImportSuite> ptrImportSuite(static_cast<IImportSuite *>(Utils<ISelectionUtils>()->QuerySuite(IImportSuite::kDefaultIID)));
if (ptrImportSuite != nil)
{
IDFile TaggedTextFile;
if (CoreFileUtils::CreateUniqueTempFile( "My Tagged Text ", "", TaggedTextFile ))
{
if (WriteToFile( TaggedTextFile, TaggedText ))
{
URI ResourceID;
if (Utils<IURIUtils>()->IDFileToURI( TaggedTextFile, ResourceID ))
{
ptrImportSuite->DoImport( ResourceID,
DocumentReferenceID.GetDataBase(),
kTrue,
kMinimalUI,
kTrue,
kTrue,
kFalse );
}
}
TaggedTextFile.Delete();
}
}
The tagged text is imported with no problems and is correctly formatted
. I can save and reopen the document with no problems.
Now if I open the same document via InDesign Server, I see this...
09/23/11 13:40:04 ERROR [link manager] Link missing.; file:c:/TEMP/My%20Tagged%20Text%20480877211421
09/23/11 13:40:04 ERROR [link manager] Link missing.; file:c:/TEMP/My%20Tagged%20Text%20480877212218
09/23/11 13:40:04 ERROR [link manager] Link missing.; file:c:/TEMP/My%20Tagged%20Text%20480877212984
09/23/11 13:40:04 ERROR [link manager] Link missing.; file:c:/TEMP/My%20Tagged%20Text%20480877213234
09/23/11 13:40:04 ERROR [link manager] Link missing.; file:c:/TEMP/My%20Tagged%20Text%20480877213406
09/23/11 13:40:04 ERROR [link manager] Link missing.; file:c:/TEMP/My%20Tagged%20Text%20480877213609
09/23/11 13:40:04 ERROR [link manager] Link missing.; file:c:/TEMP/My%20Tagged%20Text%20480877213875
09/23/11 13:40:04 ERROR [link manager] Link missing.; file:c:/TEMP/My%20Tagged%20Text%20480877222812
09/23/11 13:40:04 ERROR [link manager] Link missing.; file:c:/TEMP/My%20Tagged%20Text%20480877238171
The document has opened and I can edit the imported text - so it would appear that the text is embedded in the document. But InDesign Server is complaining that links to the text files are missing. Which should it be - no embedded text with linked files or embedded text and no linked files? What I'm after is embedded text with no linked files as the files are temporary and only a means to an end.
If I open the document in the Desktop application, the Links tab is not showing any links, which is what I'd expect. So what's up with Server? I should also note that in Preferences\File Handling\Links "Create Links When Placing Text and Spreadsheet Files" is using the default setting - unchecked.
Any insight on this would be appreciated.
Regards,
Andrew
PS - I'm on holiday next week!
Hi Folks,
I'd forgotten about this particular problem, but here I am again as I still have no solution for it. On a number of documents, I am now seeing a number of frames contain a large number of links and I cannot see a way to access them to remove them (whether this be by changing the resource state, I don't know).
Earlier on I tried something simple by simply getting hold of ILinkManager and calling QueryLinks(). As expected it returned no links! Another aspect of this issue can be seen in the screenshot below - there are no links, yet the tooltip specifies that there are 2 unique links (I imported tagged text into the same frame twice).
I now have two projects using slightly different approaches to importing tagged text. One uses IImportSuite::DoImport() as mentioned before and the other uses IImportResourceCmdData\IReplaceCmdData. Both import with no problems apart from this annoying side-effect.
Has anyone got any ideas?
Thanks in Advance,
Andrew
I came back to this problem last month and finally come up with a solution.
Having imported the tagged text file I set up a LinkResourceQuery and call its SetURI() method with the resource URI from my first post. That query is then passed to the ILinkManager method QueryResources(). I then take the results, build up a UIDList of ResourceIDs and then create a command using kLinkResourceDeleteCmdBoss.
Now every time I add tagged text to a frame from a temporary file, I don't accumulate missing links
.
Cheers,
Andrew
North America
Europe, Middle East and Africa
Asia Pacific