using System;
using System.Configuration;
using SelectPdf;

namespace SelectPdf.Samples
{
    public class Global : System.Web.HttpApplication
    {
        protected void Application_Start(object sender, EventArgs e)
        {
            // Apply the DenyLocalFileAccess flag from Web.config globally.
            // When true, SelectPdf rejects any attempt to convert local files / file:// URLs.
            bool deny;
            bool.TryParse(ConfigurationManager.AppSettings["DenyLocalFileAccess"], out deny);
            GlobalProperties.ForceDenyLocalFileAccess = deny;
        }
    }
}
