TwainPRO 9 for ActiveX - User Guide > How To > Acquire Images and Image Information > Transfer & Save Multi-Page Images |
When the SaveUseIFDOffset property is false (default), the image is appended to the end of the multi-page TIFF. Due to the linked format of TIFF, the software must traverse all the link pointers to identify the location to which the new page will be appended. The greater the number of pages in the target TIFF file, the longer the write process takes. (Typically, if the target file has more than 1000 pages, the write speed will degrade substantially.)
Setting the SaveUseIFDOffset property to true specifies that the control should write the image to the location stored in the SaveIFDOffset property. This enables much faster writing of TIFF files with many pages because the software can seek to that location without traversing all previous pointer links. This process gives very predictable speeds in adding pages to a multi-page TIFF file.
Important: If the file's IFDOffset ever became out of sync with the SaveIFDOffset property value, file corruption could occur. To protect the application from inadvertently corrupting a saved mutli-page file, the Twain PRO™ control takes the following measures:
VB Example |
Copy Code
|
---|---|
' This code demonstrates how to use the SaveUseIFDOffset and SaveIFDOffset properties to safely enable fast TIFF writing Dim outputFile As String Dim myIfdOffset As Long Public Sub SaveMpTiffUsingIfd() tp.SaveMultiPage = True tp.SaveFileType = TP_SaveFileType_Tiff outputFile = App.Path & "\mpIfd.tif" Dim fso As New FileSystemObject If fso.FileExists(outputFile) Then Kill outputFile End If Set fso = Nothing tp.StartSession End Sub Private Sub tp_PostScan(Cancel As Boolean) tp.SaveUseIFDOffset = True tp.SaveIFDOffset = myIfdOffset tp.SaveFile outputFile myIfdOffset = tp.SaveIFDOffset End Sub |