47
39
var ts_pdf_backend="CGI";
PDF generation is initiated by .Net and passed to
the tiffpilot.exe CGI process.
var check_tiff_files = “true”
This variable was introduced to help with the
handling of problematic TIFF files, it repairs the
file before converting it to a PDF file and it also
repairs the TIFF file before rendering it.
13.7 Custom Backend Development
TIFF Server is delivered with the C# source code for a special customizable class,
AquaforestTIFFServerStream. This class has three methods which can be used to customize TIFF
Server so that for example, the product can read encrypted TIFF images or read from a database other
than SQL Server.
The sample project uses a simple “encryption” scheme.
The Microsoft Visual Studio 2005 project can be found in custom/AquaforestTIFFServerStream in the
TIFF Server installation folder.
static public MemoryStream GetStream(string TIFFFilePath)
This method returns a TIFF file as a memory MemoryStream. The supplied implementation returns the
TIFF file specified by the TIFFFilePath parameter as a MemoryStream.
static public string GetAnnotations(string AnFilePath)
This method returns the contents of an annotation file as a file as a string. The supplied
implementation returns the annotation file specified by the AnFilePath parameter as a string.
static public bool SaveAnnotations(string FilePath, string Annotations)
This method saves the contents of an annotation file. The supplied implementation saves the string in
the specified annotation file.
13.7.1 Implementing a Custom Backend
This involves the following steps
Set ts_net_backend=”CUSTOM” in the config.inc file.
Make the required changes to the AquaforestTIFFServerStream class and rebuild.
Move the AquaforestTIFFServerStream.dll (from custom/AquaforestTIFFServerStream/bin)
to the bin directory.
Run iisreset
13.8 Edit Functionality and Custom Modules
When a custom backend is implemented the following custom method will be called :
CustomClass.SaveEditedImages(String TIFFFileName, MemoryStream[] TiffStreams, String
AnnotationFileName, MemoryStream[] AnnotationStreams)
Where FileName is the full path of the original TIFF file, and one MemoryStream is provided for each
newly generated TIFF file.
13.9 File Locking in Edit Functionality with Custom Modules
If locking is turned on (via lock_editdoc in config.inc) and the backend is CUSTOM call will be made
to a custom module to Lock before opening the edit page :
Bool CustomClass.Lock(string FileName)