سؤال

Using LibTiff, following will get the 2nd page and save as SplitTiffImage_2ndPage.tif.

string[] arguments =
{
  @"Sample Data\multipage.tif,1",
  "SplitTiffImage_2ndPage.tif"
};
TiffCP.Program.Main(arguments);

How to split all the pages in a multipage tif? Please help.

هل كانت مفيدة؟

المحلول

You are using this example. On the same site you can find an example how to get the number of pages of a tiff. You can combine the two examples to extract all pages by looping from 0 to num_of_pages - 1 with a simple for loop and build the appropriate two strings and with these two strings the argument array for TiffCP.Program.Main for every index.

First page -> string[] arguments = {@"Sample Data\multipage.tif,0", "SplitTiffImage_Page1.tif"

Second page -> string[] arguments = {@"Sample Data\multipage.tif,1", "SplitTiffImage_Page2.tif"

and so on...

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top