←Select platform

NoPageNumber Property

Summary
Enables or disables updating the PageNumber tag associated with the pages of a multipage TIFF file.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public bool NoPageNumber { get; set; } 
@property (nonatomic, assign) BOOL noPageNumber; 
public boolean getNoPageNumber() 
public void setNoPageNumber(boolean value) 
public: 
property bool NoPageNumber { 
   bool get(); 
   void set (    bool ); 
} 
NoPageNumber # get and set (CodecsTiffSaveOptions) 

Property Value

Value Description
true To disable updating the PageNumber tag associated with the pages of a multipage TIFF file.
false To enable updating the PageNumber tag associated with the pages of a multipage TIFF file. The default value is false.
Example
C#
Java
using Leadtools; 
using Leadtools.Codecs; 
 
using Leadtools.ImageProcessing.Core; 
using Leadtools.Pdf; 
 
public void CodecsTiffOptionsExample() 
{ 
   RasterCodecs codecs = new RasterCodecs(); 
 
   string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "OCR1.TIF"); 
 
   // Get all Information about the Tiff file that you want to load. 
   CodecsImageInfo imageInfo = codecs.GetInformation(srcFileName, true); 
 
   if (imageInfo.Tiff.IsImageFileDirectoryOffsetValid) 
   { 
      codecs.Options.Tiff.Load.ImageFileDirectoryOffset = imageInfo.Tiff.ImageFileDirectoryOffset; 
      codecs.Options.Tiff.Save.ImageFileDirectoryOffset = imageInfo.Tiff.ImageFileDirectoryOffset; 
   } 
 
   // CodecsTiffOptions & CodecsTiffLoadOptions reference 
   codecs.Options.Tiff.Load.UseImageFileDirectoryOffset = imageInfo.Tiff.IsImageFileDirectoryOffsetValid; 
   codecs.Options.Tiff.Save.UseImageFileDirectoryOffset = imageInfo.Tiff.IsImageFileDirectoryOffsetValid; 
 
   codecs.Options.Tiff.Load.IgnorePhotometricInterpretation = true; 
   codecs.Options.Tiff.Load.IgnoreViewPerspective = false; 
   codecs.Options.Tiff.Load.UseFastConversion = false; 
 
   RasterImage image = codecs.Load(srcFileName); 
 
   codecs.Options.Tiff.Save.NoPalette = imageInfo.Tiff.HasNoPalette; 
   codecs.Options.Tiff.Save.PreservePalette = imageInfo.Tiff.HasNoPalette; 
 
   // Set the tiffSave options 
   // CodecsTiffSaveOptions reference 
   codecs.Options.Tiff.Save.NoPageNumber = false; 
   codecs.Options.Tiff.Save.NoSubFileType = false; 
   codecs.Options.Tiff.Save.UsePhotometricInterpretation = true; 
   codecs.Options.Tiff.Save.PhotometricInterpretation = CodecsTiffPhotometricInterpretation.YcbCr; 
   codecs.Options.Tiff.Save.UseTileSize = true; 
   codecs.Options.Tiff.Save.TileHeight = 200; 
   codecs.Options.Tiff.Save.TileWidth = 200; 
   codecs.Options.Tiff.Save.NoLzwAutoClear = false; 
   codecs.Options.Tiff.Save.SavePlanar = false; 
   codecs.Options.Tiff.Save.UsePredictor = false; 
 
   // make the output file have the same format as the input, so Tiff->Tiff, BigTiff->BigTiff 
   codecs.Options.Tiff.Save.BigTiff = imageInfo.Tiff.IsBigTiff; 
 
   //saving the image 
   codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "testtiff1.TIF"), RasterImageFormat.Tif, image.BitsPerPixel, 1, image.PageCount, 1, CodecsSavePageMode.Overwrite); 
 
   //change some tiffsave options. 
   codecs.Options.Tiff.Save.NoPageNumber = true; 
   codecs.Options.Tiff.Save.NoSubFileType = true; 
   codecs.Options.Tiff.Save.UsePhotometricInterpretation = false; 
   codecs.Options.Tiff.Save.UseTileSize = false; 
   codecs.Options.Tiff.Save.NoPalette = false; 
   codecs.Options.Tiff.Save.PreservePalette = true; 
   codecs.Options.Tiff.Save.PhotometricInterpretation = CodecsTiffPhotometricInterpretation.Palette; 
 
   //save the image with different name. 
   codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "testtiff2.TIF"), RasterImageFormat.CcittGroup4, image.BitsPerPixel, 1, image.PageCount, 1, CodecsSavePageMode.Overwrite); 
 
   // Clean up 
   image.Dispose(); 
   codecs.Dispose(); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
 
import java.io.File; 
import java.io.IOException; 
import java.net.URI; 
import java.net.URISyntaxException; 
import java.nio.file.Paths; 
 
import org.junit.*; 
import org.junit.runner.JUnitCore; 
import org.junit.runner.Result; 
import org.junit.runner.notification.Failure; 
import static org.junit.Assert.*; 
 
import leadtools.*; 
import leadtools.codecs.*; 
import leadtools.imageprocessing.core.MinMaxBitsCommand; 
 
 
public void codecsTiffOptionsExample() { 
   final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images"; 
   RasterCodecs codecs = new RasterCodecs(); 
   String srcFileName = combine(LEAD_VARS_IMAGES_DIR, "ocr1.tif"); 
 
   // Get all Information about the Tiff file that you want to load. 
   CodecsImageInfo imageInfo = codecs.getInformation(srcFileName, true); 
 
   if (imageInfo.getTiff().isImageFileDirectoryOffsetValid()) { 
      codecs.getOptions().getTiff().getLoad() 
            .setImageFileDirectoryOffset(imageInfo.getTiff().getImageFileDirectoryOffset()); 
      codecs.getOptions().getTiff().getSave() 
            .setImageFileDirectoryOffset(imageInfo.getTiff().getImageFileDirectoryOffset()); 
   } 
 
   // CodecsTiffOptions & CodecsTiffLoadOptions reference 
   codecs.getOptions().getTiff().getLoad() 
         .setUseImageFileDirectoryOffset(imageInfo.getTiff().isImageFileDirectoryOffsetValid()); 
   codecs.getOptions().getTiff().getSave() 
         .setUseImageFileDirectoryOffset(imageInfo.getTiff().isImageFileDirectoryOffsetValid()); 
 
   codecs.getOptions().getTiff().getLoad().setIgnorePhotometricInterpretation(true); 
   codecs.getOptions().getTiff().getLoad().setIgnoreViewPerspective(false); 
   codecs.getOptions().getTiff().getLoad().setUseFastConversion(false); 
 
   RasterImage image = codecs.load(srcFileName); 
 
   codecs.getOptions().getTiff().getSave().setNoPalette(imageInfo.getTiff().hasNoPalette()); 
   codecs.getOptions().getTiff().getSave().setPreservePalette(imageInfo.getTiff().hasNoPalette()); 
 
   // Set the tiffSave options 
   // CodecsTiffSaveOptions reference 
   codecs.getOptions().getTiff().getSave().setNoPageNumber(false); 
   codecs.getOptions().getTiff().getSave().setNoSubFileType(false); 
   codecs.getOptions().getTiff().getSave().setUsePhotometricInterpretation(true); 
   codecs.getOptions().getTiff().getSave().setPhotometricInterpretation(CodecsTiffPhotometricInterpretation.YCBCR); 
   codecs.getOptions().getTiff().getSave().setUseTileSize(true); 
   codecs.getOptions().getTiff().getSave().setTileHeight(200); 
   codecs.getOptions().getTiff().getSave().setTileWidth(200); 
   codecs.getOptions().getTiff().getSave().setNoLzwAutoClear(false); 
   codecs.getOptions().getTiff().getSave().setSavePlanar(false); 
   codecs.getOptions().getTiff().getSave().setUsePredictor(false); 
 
   // make the output file have the same format as the input, so Tiff->Tiff, 
   // BigTiff->BigTiff 
   codecs.getOptions().getTiff().getSave().setBigTiff(imageInfo.getTiff().isBigTiff()); 
 
   // saving the image 
   codecs.save(image, combine(LEAD_VARS_IMAGES_DIR, "testtiff1.TIF"), RasterImageFormat.TIF, image.getBitsPerPixel(), 
         1, image.getPageCount(), 1, CodecsSavePageMode.OVERWRITE); 
 
   // change some tiffsave options. 
   codecs.getOptions().getTiff().getSave().setNoPageNumber(true); 
   codecs.getOptions().getTiff().getSave().setNoSubFileType(true); 
   codecs.getOptions().getTiff().getSave().setUsePhotometricInterpretation(false); 
   codecs.getOptions().getTiff().getSave().setUseTileSize(false); 
   codecs.getOptions().getTiff().getSave().setNoPalette(false); 
   codecs.getOptions().getTiff().getSave().setPreservePalette(true); 
   codecs.getOptions().getTiff().getSave().setPhotometricInterpretation(CodecsTiffPhotometricInterpretation.PALETTE); 
 
   // save the image with different name. 
   String outputFileName = combine(LEAD_VARS_IMAGES_DIR, "testtiff2.TIF"); 
   codecs.save(image, outputFileName, RasterImageFormat.CCITT_GROUP4, image.getBitsPerPixel(), 1, 
         image.getPageCount(), 1, CodecsSavePageMode.OVERWRITE); 
 
   assertTrue("File unsuccessfully saved to " + outputFileName, (new File(outputFileName)).exists()); 
   System.out.printf("File successfully saved to %s%n", outputFileName); 
   // Clean up 
   image.dispose(); 
   codecs.dispose(); 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Codecs Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.