You are here: GdPicture.NET > Documentation > Classes > GdPictureImaging Class > GdPictureImaging Methods > Multipage TIFF Manipulation > TiffCreateMultiPageFromFile Method
logo.gif
ContentsIndexHome
PreviousUpNext
GdPictureImaging.TiffCreateMultiPageFromFile Method

Creates a new editable multipage tiff image based on an image file.

C#
public int TiffCreateMultiPageFromFile(
    String FilePath
);
Visual Basic
Public Function TiffCreateMultiPageFromFile(
    ByVal FilePath As String
) As Integer
Parameters
Parameters 
Description 
FilePath 
The path of the file to open. If this parameter is empty, prompts the user to select a file.  
Returns

0: The image could not created. Use the GetStat() function to determine the reason this function failed. 

Non-zero: GdPicture Image Identifier. The created editable multipage tiff image.

If success, set the created image as a GdPicture image. 

Supported formats are RAW, PICT, BMP, DIB, RLE, ICO, EMF, WMF, GIF, ANIMATED GIF, JPEG, JPG, JPE, JFIF, PNG, TIFF, MULTIPAGE TIFF, PNM, PPM, PBM, PGM, PFM, RPPM, RPGM, RPBM, PCX, XPM, XBM, WBMP, TGA, SGI, Sun RAS, PSD, MNG, Kodak PhotoCD files, KOALA files, JP2, J2K, JNG, JBIG, IFF, HDR, Raw Fax G3, EXR, DDS and Dr. Halo files.

Draw page number on each page of a multipage tiff image

Dim i As Integer
Dim TiffImageID As Integer
Dim PageCount As Integer
Dim oGdPictureImaging As New GdPictureImaging
 
oGdPictureImaging.SetLicenseNumber("XXX") 'Replace XXX by a valid demo or commercial license key
oGdPictureImaging.TiffOpenMultiPageForWrite(True)
TiffImageID = oGdPictureImaging.TiffCreateMultiPageFromFile("input.tif")
PageCount = oGdPictureImaging.TiffGetPageCount(TiffImageID)
 
For i = 1 To PageCount
    oGdPictureImaging.TiffSelectPage(TiffImageID, i)
    oGdPictureImaging.DrawText(TiffImageID, "Page " & CStr(i) & " / " & CStr(PageCount), 50, 50, 10, FontStyle.FontStyleRegular, Color.Black, "Arial", True)
    oGdPictureImaging.ConvertTo1Bpp(TiffImageID) 'Comment this line to keep true color image
Next i
 
 
oGdPictureImaging.TiffSaveMultiPageToFile(TiffImageID, "output.tif", TiffCompression.TiffCompressionAUTO)
oGdPictureImaging.ReleaseGdPictureImage(TiffImageID)
What do you think about this topic? Send feedback!
Copyright (c) 2009-2011 www.gdpicture.com. All rights reserved.