VintaSoft Twain .NET SDK 14.0: Documentation for .NET developer
Vintasoft.Twain Namespace / AcquiredImage Class / Save Methods / Save(String,TwainImageEncoderSettings) Method
Syntax Exceptions Remarks Example Requirements SeeAlso
In This Topic
    Save(String,TwainImageEncoderSettings) Method (AcquiredImage)
    In This Topic
    Saves this image to a file.
    Syntax

    Parameters

    filename
    Name of file where image must be saved.
    encoderSettings
    Image encoder settings.
    Exceptions
    ExceptionDescription
    Thrown if filename is null .
    Thrown if extension of filename is unsupported.
    Thrown if error occurs at the image saving.
    Remarks

    Image can be:
    - saved as image file (BMP, JPEG, PNG, TIFF)
    - added to multipage TIFF file
    - saved into new PDF or PDF/A document
    - added to existing PDF or PDF/A document

    Available compressions for images saved into TIFF file:
    - without compression
    - CCITT Group 4 Fax compression
    - LZW compression
    - ZIP compression
    - JPEG compression

    Available compressions for images saved into PDF document:
    - without compression
    - CCITT Group 4 Fax compression
    - LZW compression
    - ZIP compression
    - JPEG compression

    Image can be added to a PDF document compatible with version 1.4 or earlier of PDF standard.


    Image will be saved as BMP file if

    • encoderSettings is null and filename contains 'bmp' extension
    • encoderSettings is not null and encoderSettings is an instance of type TwainBmpEncoderSettings

    Image will be saved as JPEG file if
    • encoderSettings is null and filename contains not 'bmp', 'png', 'pdf', 'tif' and 'tiff' extension
    • encoderSettings is not null and encoderSettings is an instance of type TwainJpegEncoderSettings

    Image will be saved as PDF file if
    • encoderSettings is null and filename contains 'pdf' extension
    • encoderSettings is not null and encoderSettings is an instance of type TwainPdfEncoderSettings

    Image will be saved as PNG file if
    • encoderSettings is null and filename contains 'png' extension
    • encoderSettings is not null and encoderSettings is an instance of type TwainPngEncoderSettings

    Image will be saved as TIFF file if
    • encoderSettings is null and filename contains 'tif' or 'tiff' extension
    • encoderSettings is not null and encoderSettings is an instance of type TwainTiffEncoderSettings

    Example

    Please see example AcquiredImage here.

    Requirements

    Target Platforms: .NET 7; .NET 6; .NET 5; .NET Core 3.1; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also