The user needs to be able to split a multipage document by selecting specific pages from the thumbnail viewer and save the selected images to a new document and save the unselected pages to another new document. I have the selected thumbnail collection coming back with the selected images but I am missing how to compare that to the original images collection so that I can go through the collection and adjust the pages based on the selection. Below is my sample code after the user selects 'Split':
sourceStream = new FileStream(this.MainView.DocumentPath, FileMode.Open);
string newPath = $"{Path.GetDirectoryName(this.MainView.DocumentPath)}\\.strickland.tif";
newStream = new FileStream(newPath, FileMode.CreateNew);
var sourceTest = new TiffFile(this.MainView.DocumentPath);
var destTest = new TiffFile((newPath));
// Save for new document with selected pages
var tiffEncoder = new TiffEncoder(true);
foreach (ThumbnailImageItem page in this.MainView.ThumbnailViewerMain.SelectedThumbnails)
{
tiffEncoder.SaveImage(page.Source, newStream);
}
The above compiles but the page.Source is null. Is there property off the ThumbnailImageItem that tells me which index the image represents in the images collection? Or some other setting that gives the index location of the selected images. Is there another direction that I should be looking at?