When trying to delete pages of a tif file, it seems that the actual tif file is not modified behind the scenes. We redraw the pages after editing the tif, but when we save the document, the document still has the pages we deleted. See below code example of what we are doing:
Code: Select all
//Deleting 3 page tif example
var status = docuVieware.GetNativeImage(out var imageId);
if (status == GdPictureStatus.OK && imageId != 0)
{
using (var image = new GdPictureImaging())
{
var imageFormat = image.GetImageFormat(imageId);
if (imageFormat != GdPicture14.DocumentFormat.DocumentFormatTIFF)
{
status = GdPictureStatus.UnsupportedImageFormat;
return status;
}
//Delete pages 2 and 3
foreach (var page in pagesToDelete)
{
status = image.TiffDeletePage(imageId, page);
if (status != GdPictureStatus.OK)
{
return status;
}
}
//Redraw page 1
docuVieware.RedrawPages(new List<int> {1}.ToArray());
}
}