PDF printing permissions

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.

using (Viewer viewer = new Viewer("sample.pdf"))
{
    ViewInfoOptions viewInfoOptions = ViewInfoOptions.ForHtmlView();
    PdfViewInfo viewInfo = viewer.GetViewInfo(viewInfoOptions) as PdfViewInfo;

    Console.WriteLine("Document type is: " + viewInfo.FileType);
    Console.WriteLine("Pages count: " + viewInfo.Pages.Count);
    Console.WriteLine("Printing allowed: " + viewInfo.PrintingAllowed);
}