Esempio n. 1
0
 public string Stamp()
 {
     var fileNameOrStream = ...                                                // Get your image from somewhere
                            using (var lifetime = AccusoftProvider.ImagXpress) // Replace this with your own license
     {
         var load = new LoadOptions();
         // All my images are multipage tiff files
         var save = new SaveOptions {
             Format = ImageXFormat.Tiff
         };
         save.Tiff.MultiPage = true;
         using (ImageX image = ImageX.FromFile(lifetime, fileNameOrStream, load))
         {
             int offset = 0;
             int pages  = ImageX.NumPages(lifetime, fileNameOrStream);
             for (int i = 0; i < pages; i++)
             {
                 image.Page            = i + 1;
                 save.Tiff.Compression = image.ImageXData.Compression;
                 var pageStamp = ".."         // Get your stamp
                                 StampImage(lifetime, pageStamp, image);
                 save.Tiff.UseIFDOffset = offset > 0;
                 save.Tiff.IFDOffset    = offset;
                 image.Save(outputFileName, save);
                 offset = save.Tiff.IFDOffset;
             }
         }
     }
 }