Print images in web application
In This Topic
1. JavaScript classes for image printing in web application
Vintasoft.Imaging.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 HTTP handler (
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();
Vintasoft.Imaging.Annotation.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 HTTP handlers (
VintasoftImageHandler and
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 a JavaScript UI dialog that can be used in web document viewer and allows to print images shown in image viewer.
WebPrintImagesJqueryDialogJS class represents a jQuery 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.