Load(string,int) Method (original) (raw)
Summary
Loads the specified page from an image file using default options.
Syntax
C#
Objective-C
C++/CLI
Python
- (nullable LTRasterImage *)loadFile:(NSString *)file
pageNumber:(NSInteger)_pageNumber_
error:(NSError **)error
Parameters
fileName
A String containing the name of the image file to load.
pageNumber
1-based index to the page number to load.
Return Value
The RasterImage object that this method loads.
Example
This example will query the number of pages from a disk file and then load them.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Color;
using Leadtools.Svg;
public void LoadPagesFromFileTest(string fileName)
{
// Create a new RasterCodecs instance
using (RasterCodecs rasterCodecs = new RasterCodecs())
{
rasterCodecs.GetFormat(fileName);
// Get the number of pages
int pageCount = rasterCodecs.GetTotalPages(fileName);
Debug.WriteLine("Number of pages in the file is {0}", pageCount);
// Load all pages
for (int pageNumber = 1; pageNumber <= pageCount; pageNumber++)
{
using (RasterImage rasterImage = rasterCodecs.Load(fileName, pageNumber))
{
Debug.WriteLine("Page {0} loaded", pageNumber);
}
}
}
}
Leadtools.Codecs Assembly
CompactFile(Stream,Stream,int,int,bool,int,int,bool,int,CodecsSavePageMode,bool,bool) Method
CompactFile(Stream,Stream,int,int,bool,long,int,bool,long,CodecsSavePageMode,bool,bool,bool) Method
CompactFile(string,string,int,int,bool,int,int,bool,int,CodecsSavePageMode,bool,bool) Method
CompactFile(string,string,int,int,bool,long,int,bool,long,CodecsSavePageMode,bool,bool,bool) Method