Xojo Conferences
MBSOct2019CologneDE

DynaPDF Manual - Page 625

Previous Page 624   Index   Next Page 626

Function Reference
Page 625 of 770
SetAnnotMigrationState
Syntax:
SI32 pdfSetAnnotMigrationState(
const PPDF* IPDF,
// Instance pointer
UI32 Annot,
// Handle of a markup annotation
TAnnotState State, // See below
const char* User)
// The user who sets the state
typedef enum
{
asNone,
asAccepted,
asRejected,
asCancelled,
asCompleted,
asCreateReply
}TAnnotState;
The function adds a migration state or a reply to a markup annotation. All annotation types with
exception of 3D, Link, Movie, Screen, PrinterMark, TrapNet, and Watermark are markup
annotations.
Migration states are stored in text annotations as reply to the base annotation. Further states are
stored as reply to the last reply and so on; the result is a single linked list. Because the base
annotation contains no reference to the last reply or migration state the function must search for it.
To speed up processing the function returns the handle of the text annotation so that the next state
can directly be added to this annotation. This handle is also required if a reply should be created.
A reply contains usually a comment or text from a user. This string can be set with SetAnnotString()
(the string Content must be set).
Example (C++):
SI32 annot, reply;
PPDF* pdf = pdfNewPDF();
if (!pdf) return -1;
pdfCreateNewPDF(pdf, "out.pdf");
pdfSetPageCoords(pdf, pcTopDown);
pdfAppend(pdf);
annot = pdfSquareAnnot(pdf, 50.0, 50.0, 200.0, 100.0, 1.0, NO_COLOR,
255, csDeviceRGB, "Jim", "Test", "Just test...");
reply = pdfSetAnnotMigrationState(pdf, annot, asCreateReply, "Harry");
pdfSetAnnotString(pdf, reply, asContent, "This is a reply!");
pdfEndPage(pdf);
pdfCloseFile(pdf);
pdfDeletePDF(pdf);
Remarks:
This function is implemented in an Ansi and Unicode compatible variant. A migration state or
annotation reply is defined since PDF 1.5. The function adjusts the PDF version automatically if it is
lower than PDF 1.5.
 

Previous topic: SetAnnotLineEndStyle, SetAnnotLineDashPattern

Next topic: SetAnnotOpacity, SetAnnotOpenState