Check if PDF printing not allowed

GroupDocs.Viewer provides additional information for PDF documents when calling getViewInfo() method. To retrieve view information for PDF document call getViewInfo() method and cast output result to PdfViewInfo type.

Following example demonstrates how to retrieve view information for PDF document.

    try (Viewer viewer = new Viewer("sample.pdf")) {
        ViewInfoOptions viewInfoOptions = ViewInfoOptions.forHtmlView();
        PdfViewInfo viewInfo = (PdfViewInfo) viewer.getViewInfo(viewInfoOptions);
    
        System.out.println("Document type is: " + viewInfo.getFileType());
        System.out.println("Pages count: " + viewInfo.getPages().size());
        System.out.println("Printing allowed: " + viewInfo.isPrintingAllowed());
    }