Save signed images with various output types
Leave feedback
Signature class supports saving of Image signed documents with various image format types and extended options.
Following classes are inherited from base class SaveOptions and allows to specify additional output image format settings.
BmpSaveOptions class allows to save signed image document to BMP image format and setup additional options ( like compression, resolutions, bits per pixel etc);
GifSaveOptions class allows to save signed image document to **GIF **image format and setup additional options ( like compression, resolutions etc);
JpegSaveOptions class allows to save signed image document to JPEG image format and setup additional options ( like compression, resolutions, quality etc);
PngSaveOptions class allows to save signed image document to PNG image format and setup additional options ( like bit depth, color type, compression, filters etc);
TiffSaveOptions class allows to save signed image document to TIFF image format and setup additional options
Here are the steps to save signed Image document to special image output type with additional settings with GroupDocs.Signature:
Create new instance of Signature class and pass source document path or stream as a constructor parameter.
Call sign method of Signature class instance and pass signatureoptions and SaveOptions object to it.
Save signed image as BMP
Signaturesignature=newSignature("sample.jpg");QrCodeSignOptionssignOptions=newQrCodeSignOptions("JohnSmith");signOptions.setEncodeType(QrCodeTypes.QR);signOptions.setLeft(100);signOptions.setTop(100);// create Bmp save options with advanced settings
BmpSaveOptionsbmpSaveOptions=newBmpSaveOptions();bmpSaveOptions.setAddMissingExtenstion(true);bmpSaveOptions.setCompression(BitmapCompression.Rgb);bmpSaveOptions.setHorizontalResolution(7);bmpSaveOptions.setVerticalResolution(7);bmpSaveOptions.setBitsPerPixel(16);bmpSaveOptions.setOverwriteExistingFiles(true);signature.sign("signedSample",signOptions,bmpSaveOptions);
Save signed image as GIF
Signaturesignature=newSignature("sample.jpg");QrCodeSignOptionssignOptions=newQrCodeSignOptions("JohnSmith");signOptions.setEncodeType(QrCodeTypes.QR);signOptions.setLeft(100);signOptions.setTop(100);// create Gif save options with advanced settings
GifSaveOptionsgifSaveOptions=newGifSaveOptions();gifSaveOptions.setBackgroundColorIndex((byte)2);gifSaveOptions.setColorResolution((byte)7);gifSaveOptions.setDoPaletteCorrection(true);gifSaveOptions.setTrailer(true);gifSaveOptions.setInterlaced(false);gifSaveOptions.setPaletteSorted(true);gifSaveOptions.setPixelAspectRatio((byte)24);gifSaveOptions.setAddMissingExtenstion(true);signature.sign("signedSample",signOptions,bmpSaveOptions);
Save signed image as JPEG
Signaturesignature=newSignature("sample.jpg");QrCodeSignOptionssignOptions=newQrCodeSignOptions("JohnSmith");signOptions.setEncodeType(QrCodeTypes.QR);signOptions.setLeft(100);signOptions.setTop(100);// create Jpeg save options with advanced settings
JpegSaveOptionsjpegSaveOptions=newJpegSaveOptions();jpegSaveOptions.setAddMissingExtenstion(true);jpegSaveOptions.setBitsPerChannel((byte)8);jpegSaveOptions.setColorType(JpegCompressionColorMode.Rgb);jpegSaveOptions.setComment("signed jpeg file");jpegSaveOptions.setCompressionType(JpegCompressionMode.Lossless);jpegSaveOptions.setQuality(100);jpegSaveOptions.setSampleRoundingMode(JpegRoundingMode.Extrapolate);signature.sign("signedSample",signOptions,jpegSaveOptions);
Save signed image as PNG
Signaturesignature=newSignature("sample.jpg");QrCodeSignOptionssignOptions=newQrCodeSignOptions("JohnSmith");signOptions.setEncodeType(QrCodeTypes.QR);signOptions.setLeft(100);signOptions.setTop(100);// create png save options with advanced settings
PngSaveOptionspngSaveOptions=newPngSaveOptions();pngSaveOptions.setBitDepth((byte)8);pngSaveOptions.setColorType(PngColorType.Grayscale);pngSaveOptions.setCompressionLevel(9);pngSaveOptions.setFilterType(PngFilterType.Adaptive);pngSaveOptions.setProgressive(true);pngSaveOptions.setAddMissingExtenstion(true);signature.sign("signedSample",signOptions,pngSaveOptions);
Save signed image as TIFF
Signaturesignature=newSignature("sample.jpg");QrCodeSignOptionssignOptions=newQrCodeSignOptions("JohnSmith");signOptions.setEncodeType(QrCodeTypes.QR);signOptions.setLeft(100);signOptions.setTop(100);/// create tiff save options with advanced settings
TiffSaveOptionstiffSaveOptions=newTiffSaveOptions();tiffSaveOptions.setExpectedTiffFormat(TiffFormat.TiffNoCompressionBw);tiffSaveOptions.setAddMissingExtenstion(true);signature.sign("signedSample",signOptions,tiffSaveOptions);
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples:
Along with full-featured .NET library we provide simple, but powerful free Apps. You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online GroupDocs Signature App.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.