GetTotalPages(string) Method (original) (raw)

Summary

Gets the number of pages in a disk file image.

Syntax

C#

Objective-C

C++/CLI

Python

public int GetTotalPages( string _fileName_ )

- (NSInteger)totalPagesInFile:(NSString *)file error:(NSError **)error 

public: int GetTotalPages( String^ _fileName_ )

Parameters

fileName
A String containing the name of the image file to query.

Return Value

Number of pages in the specified file.

Example

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

StartCompress(int,int,int,RasterByteOrder,RasterViewPerspective,int,byte[],int,int,CodecsCompression,CodecsCompressDataCallback) Method