Skip to main content
joeyH1054
Participant
April 3, 2012
Answered

FDK How to Detect Structured Book/Document in Unstructured FrameMaker

  • April 3, 2012
  • 2 replies
  • 1015 views

Hi Everyone,

I have looked from pillar to post on this one.

Basically when you open a Structured document in Unstructured FrameMaker a warning appears stating exactly what you are doing.

I am using FDK and have tried this in both Structured and Unstructured.

The test for structure in a document is to read the FP_HighestLevelElement property,

this returns true in Structured but false for a structured document within Unstructured FrameMaker.

Lost with this one, but if FrameMaker can detect a Structured document in Unstructured then I would much like to do also.

If any input at all could be provided it would be very much appreciated.

This topic has been closed for replies.
Correct answer Russ Ward

Yes, that is correct. F_ApiOpen() requires an input property list (F_PropValsT) and populates a second list after the operation that provides details about what went on. You need to configure the input property list to prohibit the opening of the file (FP_FileIsStructured = FV_DoCancel), then if the file fails to open, query the return property list for the reason. I think the flag you would be looking for is FV_CancelFileHasStructure, but I don't know for sure. In any case, Rick is right... you can't find out after you force it open, because the file is no longer structured at that point.

Russ

2 replies

joeyH1054
joeyH1054Author
Participant
April 4, 2012

Thank you very much Rick and Russ.

This is great information and answers my question.

I can see the F_PropValsT *openParamsp property list being initialised and passed to F_ApiOpen().

Would much like to mark both as the correct answer, however, the deal breaker was the extra detail from Russ which I can relate to the code in progress.

Thanks again...

frameexpert
Community Expert
Community Expert
April 4, 2012

That's OK, give it to Russ :-). He just upgraded one of his great plugins (FrameSLT).

www.frameexpert.com
frameexpert
Community Expert
Community Expert
April 3, 2012

You will have to test for this when you open the document. Once the document is opened, the structure has already been stripped, and thus FP_HighestLevelElement will always return false. You should be able to cancel the open if your client attempts to open a structured document; then you can check the return parameters to see why the open was cancelled. I am not sure exactly how to do this with the FDK, but I know you can do it with FrameScript, so you should be able to do it with the FDK.

Rick Quatro

www.frameexpert.com
Russ WardCorrect answer
Legend
April 4, 2012

Yes, that is correct. F_ApiOpen() requires an input property list (F_PropValsT) and populates a second list after the operation that provides details about what went on. You need to configure the input property list to prohibit the opening of the file (FP_FileIsStructured = FV_DoCancel), then if the file fails to open, query the return property list for the reason. I think the flag you would be looking for is FV_CancelFileHasStructure, but I don't know for sure. In any case, Rick is right... you can't find out after you force it open, because the file is no longer structured at that point.

Russ