VintaSoft Imaging .NET SDK 12.3: Documentation for Web developer
In This Topic
    Print images in web application
    In This Topic

    1. JavaScript classes for image printing in web application

    WebPrintManagerJS class is a JavaScript class intended for image print preview and further printing. The class can be created on 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 ASP.NET Core Web API controller (ASP.NET Core), ASP.NET Web API 2 controller (VintasoftImageApi2Controller), or ASP.NET HTTP handler (Vintasoft.Imaging.Web.HttpHandlers.VintasoftImageHandler).

    Here is an example that demonstrates how to print each second image from the image viewer:
    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();
    


    WebAnnotationPrintManagerJS class is a JavaScript class intended for print preview of image with annotations and further printing. The class can be created on 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 ASP.NET Core Web API controllers (Vintasoft.Imaging.AspNetCore.ApiControllers.VintasoftImageApiController and Vintasoft.Imaging.Annotations.AspNetCore.ApiControllers.VintasoftAnnotationCollectionApiController), ASP.NET Web API 2 controllers (VintasoftImageApi2Controller and VintasoftAnnotationCollectionApi2Controller) or ASP.NET HTTP handlers (Vintasoft.Imaging.Web.HttpHandlers.VintasoftImageHandler and Vintasoft.Imaging.Annotation.Web.HttpHandlers.VintasoftAnnotationCollectionHandler).

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



    2. Web Document Viewer UI for image printing in web application

    WebPrintImagesDialogJS class represents an UI dialog that can be used in web document viewer and allows to print images shown in image viewer.

    Here is screenshot of print dialog in web application:



    The main menu by default contains "Print" button in "File" sub menu.