package com.aspose.words.examples.rendering_printing;

import com.aspose.words.Document;
import com.aspose.words.ImageSaveOptions;
import com.aspose.words.SaveFormat;
import com.aspose.words.TiffCompression;
import com.aspose.words.examples.Utils;

public class SaveAsMultipageTiff {

    private static final String dataDir = Utils.getSharedDataDir(SaveAsMultipageTiff.class) + "RenderingAndPrinting/";

    public static void main(String[] args) throws Exception {

        // Open the document.
        Document doc = new Document(dataDir + "in.docx");
        //ExStart:ProgrammingSample
        // Save the document as multipage TIFF.
        doc.save(dataDir + "TestFile Out.tiff");
        //ExEnd:ProgrammingSample

        //ExStart:ImageSaveOptions
        //Create an ImageSaveOptions object to pass to the Save method
        ImageSaveOptions options = new ImageSaveOptions(SaveFormat.TIFF);
        options.setPageIndex(0);
        options.setPageCount(2);
        options.setTiffCompression(TiffCompression.CCITT_4);
        options.setResolution(160);
        doc.save(dataDir + "TestFileWithOptions Out.tiff", options);
        //ExEnd:ImageSaveOptions

        System.out.println("Document saved as multi page TIFF successfully.");
    }
}
@@ -538,18 +538,38 @@
 aDir + %22
-in
+TestFile.MultipageTIFF
 .docx%22);
@@ -587,33 +587,142 @@
 ExStart:
-ProgrammingSample
+SaveAsTIFF%0A        // For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Java
 %0A       
@@ -798,18 +798,32 @@
 TestFile
- O
+.MultipageTIFF_o
 ut.tiff%22
@@ -845,25 +845,18 @@
 End:
-ProgrammingSample
+SaveAsTIFF
 %0A%0A  
@@ -863,24 +863,25 @@
       //
+ 
 ExStart:
 ImageSav
@@ -872,16 +872,31 @@
 ExStart:
+SaveAsTIFFUsing
 ImageSav
@@ -914,16 +914,17 @@
       //
+ 
 Create a
@@ -1260,17 +1260,17 @@
 hOptions
- 
+_
 Out.tiff
@@ -1286,28 +1286,41 @@
 s);%0A    
-    
+%09
 //
+ 
 ExEnd:
+SaveAsTIFFUsing
 ImageSav
@@ -1328,17 +1328,16 @@
 Options%0A
-%0A
         

Update SaveAsMultipageTiff.java