RTF

RTF_CreateReport, RTF_FindQuestion, RTF_OpenFile, RTF_ReplaceAllLuciaFeatures, RTF_ReplaceLuciaFeature, RTF_ReplacePicture, RTF_ReplaceQuestion, RTF_ReplaceVariables

RTF_CreateReport

Description 

 RTF_CreateReport(
   char *SourceFile
);

This function creates a report from a specified report template. The template file is parsed and its filled with appropriate data.

Parameters

char *SourceFile

The template file to fill with data.

Note

This function fills the specified report template with data. Make sure you always call this function on a copy of the report template, since when the template gets filled with data, it cannot be used as a template anymore. The report template is a .rtf file that contains specific tags marking places where the data should be inserted.

See Also 
RTF_OpenFile

RTF_FindQuestion

Description 

 RTF_FindQuestion(
   char *DestinationFile,
   char *Question,
   int *Length,
   char *Directory
);

This function is for internal use only! Use RTF_CreateReport instead. RTF_FindQuestion locates a question - a specific tag within the RTF file and provides information about it.

Directory parameter is the found default value for the question (filled by the function).

Parameters

char *DestinationFile

Path to the destination file.

char *Question

Text of the question.

int *Length

Found question length.

char *Directory

Directory path.

Note

This function finds a specific string of the form $$$question$ or $$$question$$number$ in the input file. The question is returned as the Question parameter, while the number is returned as the Length parameter. The Directory parameter obviously contains the Length value in a string form.

See Also 
RTF_ReplaceQuestion

RTF_OpenFile

Description 

 RTF_OpenFile(
   char *DestinationFile
);

This function opens an RTF file for viewing.

Parameters

char *DestinationFile

Path to the destination file.

Note

This function opens the specified RTF file for viewing. The file is opened in a default application registered for handling RTF files, which would usually be WordPad or Microsoft Word. The file should have .rtf extension for the function to run properly.

See Also 
RTF_CreateReport

RTF_ReplaceAllLuciaFeatures

Description 

 RTF_ReplaceAllLuciaFeatures(
   char *SourceFile
);

This function is for internal use only! Use RTF_CreateReport instead. RTF_ReplaceAllLuciaFeatures replaces special tags within the source .rtf file by their values.

Parameters

char *SourceFile

The file to perform the replacements in.

Note

Special tags within the source .rtf file are replaced with their values. The tags can specify current time, date, measured data from the application, etc...

RTF_ReplaceLuciaFeature

Description 

 RTF_ReplaceLuciaFeature(
   char *SourceFile,
   char *Feature
);

This function is for internal use only! Use RTF_CreateReport instead.

Parameters

char *SourceFile

The file name.

char *Feature

Feature.

RTF_ReplacePicture

Description 

 RTF_ReplacePicture(
   char *SourceFile,
   char *DestinationFile,
   int  Picture,
   int  Width,
   int  Height,
   int  Mode
);

This function is for internal use only! Use RTF_CreateReport instead. RTF_ReplacePicture replaces the first occurrence of the string $$$ picture $$$ in the source file with the picture of specified parameters. The results of the replacement are stored to specified destination file.

Parameters

char *SourceFile

File to perform the replacement on.

char *DestinationFile

Path to the destination file.

int Picture

Which picture to insert. Can be one of the following:

0

The current color picture opened in the application.

1

Contents of the undo buffer - the previous state of the current picture.

2

Reference picture.

3

Annotation layer.

int Width

Image width in pixels.

int Height

Image height in pixels.

int Mode

Specifies how is the width and height information treated.

0, RTF_RELATIVE

The picture is stretched to fill the entire document. The width and height specified are ignored.

2, RTF_ABSOLUTE

The width and height values specify the size of the picture in percents. That means that width and height set to 100 will keep the picture in its original size.

1, RTF_CALIBRATED

The picture will be inserted in its calibrated size. That means that the picture should have identical physical dimensions in the document as the dimensions the picture was calibrated for. The width and height parameters are ignored.

Note

The function replaces the first $$$ tag with a picture of given dimensions. The pictures are taken from current picture buffers of the application.

RTF_ReplaceQuestion

Description 

 RTF_ReplaceQuestion(
   char *SourceFile,
   char *DestinationFile,
   char *Question
);

This function is for internal use only! Use RTF_CreateReport instead. RTF_ReplaceQuestion replaces the first occurrence of a specific tag within the .rtf file with specified data.

Parameters

char *SourceFile

File to process.

char *DestinationFile

Path to the destination file.

char *Question

Text of the question.

Note

Use this function to replace first occurrence of $$$question$ in the source file by whatever string specified. The results of replacement are stored into the destination file.

See Also 
RTF_FindQuestion, RTF_ReplacePicture

RTF_ReplaceVariables

Description 

 RTF_ReplaceVariables(
   char *SourceFile,
   char *DestinationFile
);

This function is for internal use only! Use RTF_CreateReport instead. RTF_ReplaceVariables reads the specified .rtf source file into memory and replaces all variables within it with appropriate values. A variable can be basically any piece of script contained within the &&& delimiters.

Parameters

char *SourceFile

Name of the .rtf file to parse.

char *DestinationFile

Path to the destination file.

Note

This function parses the .rtf file and replaces all occurrences of tags in the form &&& script &&& with a result of the script execution.