VintaSoft Imaging .NET SDK v8.7
In This Topic
    Print images in ASP.NET
    In This Topic

    Print images

    The Vintasoft.Imaging.WebPrintManagerJS class is a JavaScript class for image print preview and further printing. The class can be created on the client-side of web application. The class requires a web service for getting information about image and image rendering. As the web service can be used HTTP handler (VintasoftImageHandler), WCF service (VintasoftImageWcfService), Web API controller (VintasoftImageApiController) or Web API 2 controller (VintasoftImageApi2Controller).

    Here is an example that demonstrates how to print each second image from the image viewer:
    <script type="text/javascript">
        var imageViewerImages = imageViewer1.get_Images();
        var imagesToPrint = [];
        for (var i = 0; i < imageViewerImages.get_Count(); i += 2)
            imagesToPrint.push(imageViewerImages.get_Image(i));
        var printManager = new Vintasoft.Imaging.WebPrintManagerJS(imagesToPrint);
        printManager.print();
    </script>
            
    


    Print images with annotations

    The Vintasoft.Imaging.Annotation.WebAnnotationPrintManagerJS class is a JavaScript class for print preview of image with annotations and further printing. The class can be created on the client-side of web application. The class requires a web service for getting information about image and image rendering, also the class requires a web service for working with annotations. As the web services can be used HTTP handlers (VintasoftImageHandler and VintasoftAnnotationCollectionHandler), WCF services (VintasoftImageWcfService and VintasoftAnnotationCollectionWcfService), Web API controllers (VintasoftImageApiController and VintasoftAnnotationCollectionApiController) or Web API 2 controllers (VintasoftImageApi2Controller and VintasoftAnnotationCollectionApi2Controller).

    Here is an example that demonstrates how to select and print all images with annotations from the image viewer:
    <script type="text/javascript">
        var imagesToPrint = annotationViewer1.get_Images().toArray();
        var printManager = new Vintasoft.Imaging.Annotation.WebAnnotationPrintManagerJS(imagesToPrint, annotationViewer1.get_AnnotationController());
        printManager.print();
    </script>