Thread View: adobe.framemaker
7 messages
7 total messages
Started by HanzelPeter
Wed, 17 Dec 2008 13:49
FDK create CrossReference
Author: HanzelPeter
Date: Wed, 17 Dec 2008 13:49
Date: Wed, 17 Dec 2008 13:49
10 lines
1214 bytes
1214 bytes
Hello. We want programatically create a new unstructured XREF to another structured document. We know Id and name and text of that element. When we create a new XREF the target document is not opened anymore. So FM creates reference but text is not set. So XREF is not visible, but using find we can find it in document (the text is WHITESPACE). We need to open target document and call F_ApiUpdateXRefs and that text in that unstructured is updated and XREF is clickable. Is there a way to create XRef to another document, even this document is not opened in time of creating such XREF?
Re: FDK create CrossReference
Author: Russ Ward
Date: Wed, 17 Dec 2008 21:01
Date: Wed, 17 Dec 2008 21:01
16 lines
1332 bytes
1332 bytes
Hanzel, I'm not sure, but I don't think so. I believe that the text displayed by an xref is off limits... only FrameMaker itself can get in there through an update. I could be wrong. Since you know the ID and text of the target, you could do a workaround like this: - Programmtically open up some "dummy" or "scratchpad" file - Create an identical target in that file - In the same file, create an xref to that target - Update the dummy file - Copy the xref into your original document - Reset the file pointer on the newly-copied xref (FP_XRefFile) It's a bit more coding but it should work, if no one else suggests a better way. Russ
Re: FDK create CrossReference
Author: Russ Ward
Date: Thu, 18 Dec 2008 14:11
Date: Thu, 18 Dec 2008 14:11
5 lines
1160 bytes
1160 bytes
Hi Hanzel, I got curious and did some experimentation with this. I believe that my original suspicions were correct. I was able to retrieve a text location for an xref with the FP_TextRange property, but Frame would not let me add text in there, returning a FE_BadSelectionForOperation from F_ApiAddText(). So, I'll stick to my original workaround suggestion. Although it seems a bit convoluted, I don't think it would require too much code, maybe 20 lines or less. Russ
Re: FDK create CrossReference
Author: Ian Hawkins
Date: Thu, 18 Dec 2008 19:25
Date: Thu, 18 Dec 2008 19:25
4 lines
855 bytes
855 bytes
It's been a while since I looked at this, but can't you set the FP_XRefSrcText property of the FO_XRef object? Ian
Re: FDK create CrossReference
Author: Scott_Prentice
Date: Thu, 18 Dec 2008 22:09
Date: Thu, 18 Dec 2008 22:09
5 lines
762 bytes
762 bytes
Hey Russ... Did you try setting FP_Locked to False before editing the FP_XRefSrcText text? I'd swear that I did this at one point .. but I could be mistaken. ...scott
Re: FDK create CrossReference
Author: Russ Ward
Date: Thu, 18 Dec 2008 22:22
Date: Thu, 18 Dec 2008 22:22
13 lines
1392 bytes
1392 bytes
Hi Ian and Scott, I hadn't noticed the FP_Locked property before, but it still didn't work when I set it to False. Here's what the FDK ref says about FP_Locked: "True if the cross-reference is part of a text inset that retains formatting information from the source document. The cross-reference is not affected by global formatting performed on the document." I'm not sure that is applicable to what we are talking about. Also, I tried setting FP_XRefSrcText, but the text in the document view did not change. I remember trying that before but never having any success. The only way to get the text to update was through an FM update, which updates FP_XRefSrcText also. Which is what Hanzel wants to avoid. Nonetheless, it may be that you have done it before and I just don't know how. Russ
Re: FDK create CrossReference
Author: Russ Ward
Date: Thu, 18 Dec 2008 22:25
Date: Thu, 18 Dec 2008 22:25
1 lines
701 bytes
701 bytes
Hanzel, by the way, if your first name is actually Peter, my apologies.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads