ClearImage COM API
Append Method
CiImage Object : Append Method
Path to existing local or network file
Description
Append image to a file
Syntax
Visual Basic
Public Sub Append( _
   ByVal FileName As String, _
   Optional ByVal Format As EFileFormat = ciTIFF_G4 _
) 
Parameters
FileName
Path to existing local or network file
Format
ValueDescription
ciBMPBMP format. bpp= 1, 8, 24
ciEXTFormat is based on file name extension
cifICLImage Cash Letter format. bpp=1, 8, 24
cifPDFPDF Format. bpp=1, 8, 24
ciGIFGIF format. bpp= 1, 8, 24. Read only
ciICOWindows icon format, 255x255 max. bpp=8, 24
ciJBGJBIG format. bpp=1. Read only
ciJP2JPEG-2000 format. bpp=8, 24
ciJPCJPEG 2000 Code stream. bpp=8
ciJPGJPEG format. bpp=8, 24
ciPCXPCX format. bpp= 1, 8, 24
ciPGXJPEG-2000 verification model. bpp=8
ciPNGPortable Network Graphic format. bpp= 1, 8, 24
ciPNMPortable aNyMap format. bpp=8
ciTGATarga format. bpp=8, 24
ciTIFFUncompressed TIFF format. bpp= 1, 8, 24
ciTIFF_G3_1DTIFF Group 3 compression, bpp=1
ciTIFF_G4TIFF Group 4 compression, bpp=1
ciTIFF_JPEGTIFF JPEG compression, bpp=8, 24
ciTIFF_LZWTIFF LZW compression, bpp=1, 8, 24
ciTIFF_NEOLTIFF No-end-of-line compression, bpp=1
ciWBMPWireless Bitmap format, 255x255 max. bpp=1
ciWEBPWEBP. bpp=24
ciWMFWindows Metafile
Remarks

This method appends to the existing TIFF or PDF file. If a file does not exist the new file is created with the format specified by Format parameter. If Format=ciEXT, then the format is derived from the  FileName extension. Image compression of TIFF and PDF files is controlled by pComprBitonal and pComprColorExJpegQuality property controls compression when pComprColor=citcJPEG or file format is JPEG.

Only valid Format values are ciEXT, cifPDF, or formats starting with ciTIFF or  are valid.  The default format for bi-tonal images is ciTIFF_G4. The default format for color and grayscale images is ciTIFF_LZW.

See Image file saving guidelines on Inlite's How-to Web Site

Example
Sub OpenSaveAppendImages(imageFile1 As String, imageFile2 As String, pdfFileOut As String)
  Dim Ci As New CiServer
  Dim Image As CiImage: Set Image = Ci.CreateImage
    ' Create PDF file with image from the first file
  Image.Open imageFile1, 1
  Image.SaveAs pdfFileOut, cifPDF
    ' Append to PDF file image from the second file
  Image.Open imageFile2, 1
  Image.Append pdfFileOut, cifPDF
    '  Open PDF and show image information
  Image.Open pdfFileOut, 2
  ShowImageInfo Image
    '  Close image
  Image.Close
End Sub

Sub ShowImageInfo(Image As CiImage)
  Debug.Print "  File='" & Image.fileName & "'" & " Page=" & Image.PageNumber & " PageCount=" & Image.PageCount & "  Format=" & Image.Format & vbCrLf
  Debug.Print "  Width=" & Image.Width & "  Height=" & Image.Height & "  BPP=" & Image.BitsPerPixel & " HorzDpi=" & Image.HorzDpi & "   VertDpi=" & Image.VertDpi & vbCrLf
End Sub
Sub ProcessMultiPageFile(imageFile As String)
  Dim Ci As New CiServer
  Dim Image As CiImage: Set Image = Ci.CreateImage
  Dim page As Integer, pageCount As Integer
  Image.Open imageFile
  pageCount = Image.pageCount
    ' for each page
  For page = 1 To pageCount
    Image.Open imageFile, page
        '  Process  image page, for example
        '  ==== Read barcodes
        '     Set BarcodePro.Image = Image
        '     BarcodePro.Find 0
        '     ' process barcodes
        '  ==== Repair image
        '     Set Repair.Image = Image
        '     Repair.AutoDeskew
        '     Image.Append sFileOut ' save
  Next
End Sub
See Also

CiImage Object  | CiImage Members  | Open  | Save  | SaveAs  | Append