We are scanning a document, and we add the image in a pdf with a MRC compressio using GdPicturePdf :
Code: Select all
pdf.AddImageFromGdPictureImage(imageID, PdfAdvancedImageCompression.PdfAdvancedImageCompressionMRC);
Before MRC, I was looping the images of the pages, and convert each using GdPictureImaging.FxGrayScale :
Code: Select all
GdPictureImaging oGdPictureImaging = new GdPictureImaging();
// Convertir chaque image de la page en Degradé de gris
for (int image = 1; image <= _nativePdf.GetPageImageCount(); image++)
{
int imageID = _nativePdf.ExtractPageImage(image);
// Conversion de l'image en dégradé
oGdPictureImaging.FxGrayscale(imageID);
// degrade B&W to bitonal
//oGdPictureImaging.ColorDetection(imageID, true, true, true);
// Remplacer l'image dans le PDF
_nativePdf.ReplaceImage(_nativePdf.GetPageImageResName(image), imageID, false);
oGdPictureImaging.ReleaseGdPictureImage(imageID);
}
oGdPictureImaging.Dispose();
I am unable to find a way, even when using the imageMask parameter of the replaceImage function.
Can you please review my code, and give me a tip ?
I've attached my sample.
Thanks