Set image quality

On this page

GroupDocs.Annotation v22.4 and later allows you to set the quality of an image added to a document. To do this, specify the imageQuality parameter of the AddImageToDocument method.

The parameter value is from 1 to 100. 1 means the lowest resolution, and 100 means the highest.

The following code snippet shows how to set the image quality:

using (Annotator annotator = new Annotator("input.pdf-file")) // specify the path to the input PDF file
{
	string dataDir = "input.pdf"; // specify the path to the input PDF file
    string data = "image.jpg"; // the path to the JPG file
    int pageNumber = 1; // set the page where the image will be inserted
    int imageQuality = 10; // set image quality from 1 to 100
    annotator.Document.AddImageToDocument(dataDir, data, pageNumber, imageQuality);
}

On this page