How to check that PDF printing not allowed

Checking that sprinting 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.

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);
}

More resources

View PDF Documents Online

Along with full-featured .NET library we provide simple but powerful free online Apps. View PDF files online with GroupDocs Viewer App.

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples: