Open documents with an offset
Blogged by Björn Meyer on December 12, 2005 and tagged with Samples, ActiveX, .NET.
TX Text Control ActiveX offers an Offset parameter to export a document with a specific file offset position. This offset can be used to save a custom file header that could contain additional information. Many customers have been asking how to open these documents with TX Text Control .NET.
A very simple way to achieve this is to use a FileStream that can be directly opened using the Load method in TX Text Control .NET. The following code snippet illustrates how to open a file with an offset of 30 bytes. The Position property of the FileStream can be used to set the current position in the stream. This position indicates where TX Text Control .NET starts reading.
Dim newFile As New System.IO.FileInfo("c:\file.tx")
Dim FileStream As System.IO.FileStream = newFile.OpenRead()
FileStream.Position = 30
TextControl1.Load(FileStream, TXTextControl.BinaryStreamType.InternalFormat)
