Class PageRange
Class PageRange
Namespace: Aspose.Words.Saving
Assembly: Aspose.Words.dll (25.12.0)
Represents a continuous range of pages.
To learn more, visit the Programming with Documents documentation article.
public sealed class PageRangeInheritance
Inherited Members
object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
Shows how to extract pages based on exact page ranges.
Document doc = new Document(MyDir + "Images.docx");
ImageSaveOptions imageOptions = new ImageSaveOptions(SaveFormat.Tiff);
PageSet pageSet = new PageSet(new PageRange(1, 1), new PageRange(2, 3), new PageRange(1, 3),
new PageRange(2, 4), new PageRange(1, 1));
imageOptions.PageSet = pageSet;
doc.Save(ArtifactsDir + "ImageSaveOptions.ExportVariousPageRanges.tiff", imageOptions);Constructors
PageRange(int, int)
Creates a new page range object.
public PageRange(int from, int to)Parameters
from int
The starting page zero-based index.
to int
The ending page zero-based index. If it exceeds the index of the last page in the document, it is truncated to fit in the document on rendering.
Examples
Shows how to extract pages based on exact page ranges.
Document doc = new Document(MyDir + "Images.docx");
ImageSaveOptions imageOptions = new ImageSaveOptions(SaveFormat.Tiff);
PageSet pageSet = new PageSet(new PageRange(1, 1), new PageRange(2, 3), new PageRange(1, 3),
new PageRange(2, 4), new PageRange(1, 1));
imageOptions.PageSet = pageSet;
doc.Save(ArtifactsDir + "ImageSaveOptions.ExportVariousPageRanges.tiff", imageOptions);Remarks
System.Int32.MaxValue means the last page in the document.