VintaSoft Imaging .NET SDK and Plug-ins Discussions

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Board index < VintaSoft Imaging < VintaSoft Imaging .NET SDK and Plug-ins Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

Split Multipage Tiff Document



Split Multipage Tiff Document

Post by rstrickland1958 »

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?


Re: Split Multipage Tiff Document

Post by Alex »

Hello,

The VintasoftImage.SourceInfo property allows to get information (source filename, page index, etc) about image:
https://www.vintasoft.com/docs/vsimagin ... eInfo.html

Please use information about image for sorting images in image collection and let me know if you will have any question or problem.

Best regards, Alexander


Page 1 from 1: 1