DotNet framework 1.1 (not tested the same in 2.0)
Make sure you have the following references in BIN
Atalasoft.dotImage.dll
Atalasoft.dotImage.Lib.dll
Atalasoft.dotImage.Webcontrols.dll
Atalasoft.shared.dll
Use the following NameSpaces
Imports Atalasoft.Imaging
Imports Atalasoft.Imaging.WebControls
Imports Atalasoft.Imaging.ImageProcessing
Imports Atalasoft.Imaging.Codec
Imports Atalasoft.Imaging.Codec.Tiff
Avoid using Workspace object for simple tasks. As workspace occupies more memory (according to Atalasoft unofficial sources) and most of the operations can be done using AtalaImage object.
Annotate ONE PAGE TIFF Document
Dim tiffImage As AtalaImage
Dim watermarkimage As AtalaImage = New AtalaImage(Server.MapPath(“.”) & “watermark.jpg”)Dim overlay As OverlayCommand
Dim newAnnoatedFileName as String
tiffImage = New AtalaImage(Server.MapPath(“.”) & “Sample.tif”, 0, Nothing)
newAnnoatedFileName = Server.MapPath(“.”) & ”\Sample-Annoated.tif”
‘Image Overlay
overlay = New OverlayCommand(watermarkimage, New Point(350, 550), 0)
overlay.Apply(tiffImage)
‘False in TiffEncoder means dont append (as the file is created for the first time there is nothing to append to.)
tiffImage.Save(newAnnoatedFileName, New TiffEncoder(TiffCompression.Default, False), Nothing)
————————————————————————————Annotate MULTIPAGE TIFF Document
Dim tiffImage As AtalaImage
Dim watermarkimage As AtalaImage = New AtalaImage(Server.MapPath(“.”) & “watermark.jpg”)Dim overlay As OverlayCommand
Dim newAnnoatedFileName as String
Dim numberofpages as integer,iCount as integernumberofpages = RegisteredDecoders.GetImageInfo(Server.MapPath(“.”) & “Sample.tif”).FrameCountnewAnnoatedFileName = Server.MapPath(“.”) & ”\Sample-Annotated.tif”’350,550 does the annotation from Bottom Left to Top Right.
’0 is the set the transparency in the top Image. (Dot Image 4.0)
‘Use 1 if you are using Dot Image 3.0
overlay = New OverlayCommand(watermarkimage, New Point(350, 550), 0)
For iCount = 0 To numberOfPages – 1
‘Opens one frame (page) at a time as specified in iCount
tiffImage = New AtalaImage(Server.MapPath(“.”) & “Sample.tif”, iCount, Nothing)‘Image Overlay
overlay.Apply(tiffImage)‘Save the first page with FALSE param (as there is nothing to append to) for other pages set it to TRUE so that the same TIFF gets appended with multi frames (pages)If iCount = 0 Then
tiffImage.Save(newAnnoatedFileName, New TiffEncoder(TiffCompression.Default, False), Nothing)
ElsetiffImage.Save(newAnnoatedFileName, New TiffEncoder(TiffCompression.Default, True), Nothing)End IfNextIf Not watermarkimage Is Nothing Then
watermarkimage.Dispose()
End IfIf Not tiffImage Is Nothing Then
tiffImage.Dispose()
End If
If Not overlay Is Nothing Then
overlay = Nothing
End If