문제

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