Macro Language Reference > Macros > Page > tpmkset
  
tpmkset
Description
Creates bookmarks and URI links, within or between PTC ALD documents and PDF output.
 
Example 174. Create a bookmark tag that links to a bookmark in a .3d file
The following example will create a bookmark link tag that, when executed, will open the demo.3d file normally located in the /3d directory and go to the bookmark called demo--lnk--1 within that document . The link will be included in both Acrobat's outline list and the outline for page number five.
tpmkset "demo--lnk--1","link to demo lnk 1","demo--lnk--1",
"c:/3b2win/3d/demo.3d",5,0
 
Example 175. Define a mailto link for PDF output
The syntax below will produce a mailto link in the output PDF document.
With the URI link type the 'mailto' can be changed to any URI type you need following the standard conventions.
tpmkset "Link1","Link to www.ptc.com","",
"*mailto:documentation@ptc.com"
 
Example 176. Set a bookmark link to a point within the same document
This example sets a bookmark link to the a point in the demo.3d file from within the same document. The link will be included in the Acrobat outline list and PTC ALD will be instructed to fit the whole page.
tpmkset "demo--lnk--1","link to demo lnk 1",0,0
 
Example 177. Show a bookmark link to a tag and run it in a script to generate links
The process of link generation can be enhanced by showing the link to a tag (in this example, a tag named connect), which is then run using trun to activate the links. Note the inclusion of $10# at the end of the command, which will insert a return in connect.rf after every entry.
<?show +"connect"tpmkset "demo--lnk--1","link to demo lnk1",
"demo–lnk–1","c:/3b2win/3d/demo.3d",5,0$10#>
This example still requires manual intervention to set the name(s) etc, however. To achieve total automation of this process use a getvar, a variable value and/or counter values to generate the names, which in turn could be set from attribute tag values and text yanked from the text stream.
For instance, the first section of the example below (tpmkset "$^link_name^$x(99)") says show the contents of the link_name variable and the current value of counter x(99) to make up this link's name. At the top of the tag you will see that the counter has been set to increment by 1 each time the tag appears, therefore creating a unique number for each occurrence.
<?show +1x(99)>
<?show +"connect"tpmkset "$^link_name^$x(99)",
"This link is $^link_name^$x(99)","$^link_ name^$x(99)",
"demo.3d",5,0$10#>
Syntax
tpmkset name:t desc:s fit mode:s? remote_name:s? remote_file:s?
acrobat_outline:n? outline_page:n? hierarchy:n?
[no parameter]
Invoke the Create Bookmark Tag dialog box.
name
The name of the bookmark
desc
A description of the bookmark: up to 127 characters. The description will be used as the name of the link in Acrobat: if no description is defined then the name will be used.
fit mode
0
All
1
Width-Top
2
Width-Centre
3
Width-Bottom
4
Height-Left
5
Height-Centre
6
Height-Right
remote_name
The bookmark name to be used when pointing a bookmark to another document.
remote_file
The filename to be used when pointing a bookmark to another document or a URI if the * prefix operator is used.
*
The following list contains the common recognized URI types:
http://
ftp://
file://
mailto:<name>@<address>?<subject>
 
URI type links do not appear in the PDF bookmarks list even if specified to do so as they do not have a document page associated with them. This means they should not appear in document navigation bookmarks.
acrobat_outline
Ø|0
Include this bookmark in Acrobat's outline list of bookmarks when the document is printed to a PostScript file, and subsequently converted to PDF using Acrobat Distiller.
1
Do not include this bookmark in Acrobat's outline list of bookmarks .
outline_page
The page of the current document to which the bookmark is related: the bookmark will then be included in the correct place in Acrobat's outline list of bookmarks for the current document. This parameter applies when creating a bookmark that points to a bookmark in another document. For example, specifying 5 will include the outline amongst other outline entries for that page.
hierarchy
The level at which a bookmark should be placed in the navigation hierarchy to the left of the page in a PDF document.
 
If the hierarchy is not complete i.e. a level is missed, the bookmark will still appear on the specified level, but the missing level beneath which it sits will be given a default name of 'Outline placeholder'.
Additional Information
In PTC ALD the setting of the bookmark or link parameters is done in one of two ways depending on the type you need. Inter-document bookmark links are generally generated with the tmark macro for simplicity although tpmkset can also be used. When generating inter-document and URI links the only applicable command is this one. The command for defining the target text or graphic from which to jump to the specified link once clicked is the same for all link types, i.e. <?tbklnk>.
 
To activate new bookmark links, the page containing the link command(s) must have been formatted.
 
To include article threads in Acrobat, seetdpref or the menu Document > Preferences > Printing.
Related Links