Macro Language Reference > Macros > Document > tdcksum
  
tdcksum
Description
Used to produce a checksum report which can be used to detect when the contents of a page, or a page range, have changed. The main function of a checksum is to provide feedback for which pages are different between two versions of a document, often identifying them as needing to be printed. The data set in question is all items that would be printed on a page, i.e. text, raster graphics etc.
 
Example 47. Example of simple application of checksum ids
This example demonstrates using a simple application of checksum ids to determine if a page in a file has changed since it was proofed by comparing the numbers on the proof to those on the electronic document:
trf: <?show $21731v>
tformat: <?show $21731v>
tprint: <?show $21731v>
The three getvar codes could be placed into the 'slug' line outside the page area on your document.
Syntax
tdcksum start page:n? ( end page:n? ) view number:n? report name:t? ( report type:n? ( old report:t? ) ) page show:s? line style:t? ( page style:t? ( trf style:t? (tformat style:t? ( tprint style:t? ) ) ) )
tdcksum
[no parameter]
Invoke the Create Page Checksum Report dialog box.
start page
The first of a range of pages to be included in the report (defaults to first page of document)
end page
The last of a range of pages to be included in the report (defaults to last page of document)
view number
The view number upon which to report (defaults to the main view 0)
report name
The name of the text stream that will contain the report.
 
If report name already exists, it will be overwritten without warning.
report type
The type of report to be generated: a full report will include a line for every page in the specified range. Other report types will be compared against a previous report, whose name is defined in the next parameter.
+
Switch mode to setting options on (default)
0
Full report: one report line for each page
1
Report on changed pages only
2
New pages only: include one report line for each page that does not appear in the old report
3
New and changed pages
4
Unchanged pages only: include one report line for each page that has the same checksum data as the old report
old report
The name of the old report to be used as comparison when using report types 1, 2, 3 or 4. The parameter must not be present for report type 0, but must be present for other types. For a successful comparison, the following parameters should all be the same as they were when the old report was produced.
page show
A show string for generating page numbers in the report. The default value is $p, which displays point numbers when frozen pages are involved and pages have been inserted. The result of this show string is used to find matching lines of a report when comparing reports with report types 1...4.
line style
The tag style for an entire report line: this parameter cannot be empty and defaults to ck line.
page style
The tag style for the page number: this parameter cannot be empty and defaults to ck page.
trf style
The tag style to use for the trf checksum of a page: defaults to ck trf. If this parameter is the empty string then trf checksums are not included in the report.
tformat style
The tag style to use for the tformat checksum of a page: defaults to ck format. If this parameter is the empty string then tformat checksums are not included in the report.
tprint style
The tag style to use for the tprint checksum of a page: defaults to ck tprint. If this parameter is the empty string then tprint checksums are not included in the report.
Additional Information
When checksum recording is enabled, PTC ALD records three values for each page, named after the macros that are usually used to update them:
trf
This checksum is updated whenever a single page is re-formatted. PTC ALD re-formats pages for a variety of reasons, such as when the trf, tformat, tpgoto or tprint macros are used, or whenever an on-screen page needs a major update such as modifying/creating frames or updating a style. Simply keying new text does not cause an immediate trf re-format and any checksums will remain (temporarily) unchanged.
tformat
This checksum is updated during a major tformat re-format or when a page is printed.
tprint
This checksum is updated only when a page is printed.
Comparing the trf and tformat checksums can detect pages where recent edits (since the last major format) have had an effect. If either of these checksums is different to the tprint checksum then it is likely that the page needs printing.
 
Checksums must be enabled before use, via the Document Preferences dialog box. See tdpref and fdpref for further information.
 
As well as producing a report, current page checksum values can also be queried using the toolbar cksumbar or the three checksum getvar codes, corresponding to the following commands:
21731
trf: page re-formats
21732
tformat: major re-formats
21733
tprint: printing the page(s)
 
By default all frames are included in the checksum report, but the tfckskip macro can be used to exclude a frame from the report, for example one that contains date/time information. The getvar code 01566 will return whether the current frame is skipped. It is still possible for a skipped frame to affect the checksum if it changes the position or flow of other text on a page that is included.
* 
The way in which the checksum value is generated may vary between software versions: changes made to the page draw process during development and bug fixes will have an effect.
Related Links