Copy link to clipboard
Copied
How can I make the first page of the file as a hyperlink using framemaker API ?
This should make the entire page as clickable to open the link on creation of pdf .
Thanks,
Asha Rayakar
Hi Asha,
If you have succeeded in making a hyperlink at all, you are on the right track. Based on your description, it sounds like you are attempting to use an existing text frame to insert your hypertext marker, a text frame that already contains text. If you put a hypertext marker into a paragraph with text, indeed, the only area that will be clickable will be that paragraph. There is nothing you can do about that... it is core FrameMaker behavior.
If you put a hypertext marker into a text frame
...Copy link to clipboard
Copied
Asha Rayakar,
As soon as you have a manual solution, you just have to turn that into an API program/script. I assume you have tried creating a textframe for the full page, then adding a Hypertext marker with the appropriate command.
- Michael
Copy link to clipboard
Copied
Hi Asha,
To reiterate what Michael said, you'll need to do it just like you would manually, except with code... I would think that you would create the FO_TextFrame object with F_ApiNewGraphicObject() and place it on the page. Then, you'll need to create the FO_marker hypertext marker with F_ApiNewAnchoredObject() in the proper text location within the text frame. There might be variations to this depending on your situation.
Although it wouldn't require a lot of code, it would be a task which involves a significant understanding of the FrameMaker object model, text navigation, and object handling. You might get lucky and someone here has some sample code, but that would not be me... I have not had the need to do this before and would not be able to take the time for the development of it right now.
Does this start you in the right direction? I'm really not sure what exactly you are asking for, specifically.
Russ
Copy link to clipboard
Copied
Hi Russ,
I am trying to make the entire text frame containing a variable as clickable hypertext. However only a single line in the textframe is clickable.
How can I select the textframe containing the variable using framemaker API ? And will the marker object be created for textFrame type ?
I am using the following reference code.
tr.beg.objId = varId; // this is the id of the Graphic Title variable
tr.end.objId = varId;
tr.beg.offset = tr.end.offset = 0; // I also tried tr.end.offset = FV_OBJ_END_OFFSET;
F_ApiSetTextRange(FV_SessionId, docId, FP_TextSelection, &tr);
mrkrId = F_ApiNewAnchoredObject(docId, FO_Marker, &tr.beg);
// Find the Hypertext marker type to get the hypertypeId
// Convert the marker into a hyperlink
F_ApiSetId(docId, mrkrId, FP_MarkerTypeId, hyperTypeId);
// Set the link
F_ApiSetString(docId, mrkrId, FP_MarkerText, (StringT)(const char *)mrkrText);
It would be great if you could give me some pointers here.
Thanks,
Asha Rayakar
Copy link to clipboard
Copied
Hi Asha,
If you have succeeded in making a hyperlink at all, you are on the right track. Based on your description, it sounds like you are attempting to use an existing text frame to insert your hypertext marker, a text frame that already contains text. If you put a hypertext marker into a paragraph with text, indeed, the only area that will be clickable will be that paragraph. There is nothing you can do about that... it is core FrameMaker behavior.
If you put a hypertext marker into a text frame that has zero text (not even a single whitespace), FrameMaker will default to making the entire frame area clickable. So, if you are attempting to make an entire page clickable, you will have to draw a new text frame that covers the entire page and insert the hypertext marker into it, with no text. You can experiment with this manually in the GUI.
In your code, you should be using FO_Pgf ids for the tr.beg.objId and tr.end.objid members. It looks like you might be using variable IDs which is incorrect. If you do have a variable ID, you can find the corresponding text range/location with its FP_TextRange property. This will return the proper FO_Pgf IDs that you need.
If you are looking for the text frame that contains a variable, you can use something like:
F_TextRangeT tr;
F_ObjHandleT textFrameId;
tr = F_ApiGetTextRange(docId, varId, FP_TextRange);
textFrameId = F_ApiGetId(docId, tr.beg.objId, FP_InTextFrame);
Does this help out at all?
Russ
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more