Created
March 3, 2020 01:39
-
-
Save aspose-com-gists/c1d9480e6f3b0a7c96ca8551e3cec762 to your computer and use it in GitHub Desktop.
Access and Export Pages in Multipage Images - Aspose.Imaging for .NET and Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (Image image = Image.Load("image.tiff")) | |
{ | |
if (image is IMultipageImage) | |
{ | |
var pages = ((IMultipageImage)image).Pages; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try (Image image = Image.load("image.tiff")) | |
{ | |
if (image instanceof IMultipageImage) | |
{ | |
Image[] pages = ((IMultipageImage)image).getPages(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int startPage = 3; | |
int countPage = 2; | |
using (Image image = Image.Load("image.gif")) | |
{ | |
TiffOptions tiffOptions = new TiffOptions(TiffExpectedFormat.TiffDeflateRgb); | |
tiffOptions.MultiPageOptions = new MultiPageOptions(new IntRange(startPage, countPage)); | |
image.Save("image.tiff", tiffOptions); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int startPage = 3; | |
int countPage = 2; | |
try (Image image = Image.load("image.gif")) | |
{ | |
TiffOptions tiffOptions = new TiffOptions(TiffExpectedFormat.TiffDeflateRgb); | |
tiffOptions.setMultiPageOptions(new MultiPageOptions(new IntRange(startPage, countPage))); | |
image.save("image.tiff", tiffOptions); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int startPage = 3; | |
int countPage = 1; | |
using (Image image = Image.Load("image.tiff")) | |
{ | |
PngOptions pngOptions = new PngOptions(); | |
pngOptions.MultiPageOptions = new MultiPageOptions(new IntRange(startPage, countPage)); | |
image.Save("image.png", pngOptions); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int startPage = 3; | |
int countPage = 1; | |
try (Image image = Image.load("image.tiff")) | |
{ | |
PngOptions pngOptions = new PngOptions(); | |
pngOptions.setMultiPageOptions(new MultiPageOptions(new IntRange(startPage, countPage))); | |
image.save("image.png", pngOptions); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment