protected void Page_Load(object sender, EventArgs e)
        {
            PluginBuilder  pb       = PluginBuilderFactory.newPluginBuilder(Request, Response);
            ParamsProvider provider = pb.getCustomParamsProvider();
            String         formula  = provider.getRequiredParameter("formula");

            // Adding - if necessary - CORS headers
            HttpResponse res    = new HttpResponse(this.Response);
            String       origin = this.Request.Headers.Get("origin");

            pb.addCorsHeaders(res, origin);

            byte[] bs = pb.newCas().showCasImage(formula, provider);
            Response.ContentType = "image/png";
            Response.OutputStream.Write(bs, 0, bs.Length);
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PluginBuilder  pb       = PluginBuilderFactory.newPluginBuilder(Request, Response);
            ParamsProvider provider = pb.getCustomParamsProvider();
            String         service  = provider.getRequiredParameter("service");
            String         r        = pb.newTextService().service(service, provider);

            // Adding - if necessary - CORS headers
            HttpResponse res    = new HttpResponse(this.Response);
            String       origin = this.Request.Headers.Get("origin");

            pb.addCorsHeaders(res, origin);

            Response.ContentType = "application/json";
            Response.Write(r);
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PluginBuilder  pb       = PluginBuilderFactory.newPluginBuilder(Request);
            ParamsProvider provider = pb.getCustomParamsProvider();
            String         resource = provider.getRequiredParameter("resourcefile");

            // Adding - if necessary - CORS headers
            HttpResponse res    = new HttpResponse(this.Response);
            String       origin = this.Request.Headers.Get("origin");

            pb.addCorsHeaders(res, origin);

            ServiceResourceLoader resourceLoader = pb.newResourceLoader();

            Response.ContentType = resourceLoader.getContentType(resource);
            Response.Write(resourceLoader.getContent(resource));
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PluginBuilder  pb       = PluginBuilderFactory.newPluginBuilder(Request);
            ParamsProvider provider = pb.getCustomParamsProvider();

            // Adding - if necessary - CORS headers
            com.wiris.system.service.HttpResponse res = new com.wiris.system.service.HttpResponse(this.Response);
            String origin = this.Request.Headers.Get("origin");

            pb.addCorsHeaders(res, origin);

            Response.ContentType = "application/json";
            String variableKeys = provider.getRequiredParameter("variablekeys");
            String r            = pb.getConfiguration().getJsonConfiguration(variableKeys);

            this.Response.Write(r);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            PluginBuilder  pb       = PluginBuilderFactory.newPluginBuilder(Request, Response);
            ParamsProvider provider = pb.getCustomParamsProvider();
            String         mml      = provider.getRequiredParameter("mml");

            if (mml == null)
            {
                throw new Exception("Missing parameter 'mml'.");
            }


            // Adding - if necessary - CORS headers
            HttpResponse res    = new HttpResponse(this.Response);
            String       origin = this.Request.Headers.Get("origin");

            pb.addCorsHeaders(res, origin);

            string r = pb.newRender().createImage(mml, provider, null);

            this.Response.Write(r);
        }