protected void Page_Load(object sender, EventArgs e) { Dictionary <string, string> param = PluginBuilderFactory.getProperties(Request); PluginBuilder pb = PluginBuilderFactory.newPluginBuilder(Request); // 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/x-javascript"; string r = pb.getConfiguration().getJavaScriptConfiguration(); outVar(Response, "createimagePath", "createimage"); outVar(Response, "showimagePath", "showimage"); outVar(Response, "editorPath", "editor"); outVar(Response, "CASPath", "cas"); outVar(Response, "createimagePath", "createimage"); outVar(Response, "createcasimagePath", "createcasimage"); outVar(Response, "getmathmlPath", "getmathml"); outVar(Response, "servicePath", "service"); this.Response.Write(r); }
protected void Page_Load(object sender, EventArgs e) { PluginBuilder pb = PluginBuilderFactory.newPluginBuilder(Request, Response); ParamsProvider provider = pb.getCustomParamsProvider(); String digest = provider.getParameter("formula", null); String mml = provider.getParameter("mml", null); if (digest == null && mml == null) { throw new Exception("Missing parameters 'formula' or 'mml'."); } // Backwards compatibility // showimage.php?formula.png --> showimage.php?formula // because formula is md5 string, remove all extensions. if (digest != null && digest.LastIndexOf(".") >= 0) { digest = digest.Substring(0, digest.LastIndexOf(".")); } Dictionary <string, string> param = PluginBuilderFactory.getProperties(Request); // Adding - if necessary - CORS headers HttpResponse res = new HttpResponse(this.Response); String origin = this.Request.Headers.Get("origin"); pb.addCorsHeaders(res, origin); if (pb.getConfiguration().getProperty("wirispluginperformance", "xml").IndexOf("true") != -1) { String useragent = provider.getParameter("useragent", ""); if (useragent.IndexOf("IE") != -1) { pb.getConfiguration().setProperty("wirisimageformat", "png"); } else { pb.getConfiguration().setProperty("wirisimageformat", "svg"); } Response.ContentType = "application/json"; Response.AddHeader("Cache-Control", "public, max-age=3600"); if (digest == null) { pb.newRender().showImage(digest, mml, provider); digest = pb.newRender().computeDigest(mml, provider.getParameters()); } string r = pb.newRender().showImageJson(digest, "en"); if (r.IndexOf("warning") != -1) { Response.AddHeader("Cache-Control", "no-cache, no-store, must-revalidate"); } Response.Write(r); } else { byte [] bs = pb.newRender().showImage(digest, mml, provider); Response.ContentType = pb.getImageFormatController().getContentType(); Response.OutputStream.Write(bs, 0, bs.Length); } }
protected void Page_Load(object sender, EventArgs e) { Dictionary <string, string> param = PluginBuilderFactory.getProperties(Request); PluginBuilder pb = PluginBuilderFactory.newPluginBuilder(Request, Response); // 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.newCas().createCasImage(param["image"]); this.Response.Write(r); }
protected void Page_Load(object sender, EventArgs e) { PluginBuilder pb = PluginBuilderFactory.newPluginBuilder(Request); ParamsProvider provider = pb.getCustomParamsProvider(); Dictionary <string, string> param = PluginBuilderFactory.getProperties(Request); // Adding - if necessary - CORS headers HttpResponse res = new HttpResponse(this.Response); String origin = this.Request.Headers.Get("origin"); pb.addCorsHeaders(res, origin); CleanCache cleanCache = pb.newCleanCache(); cleanCache.init(provider); string output = cleanCache.getCacheOutput(); Response.ContentType = cleanCache.getContentType(); Response.Write(output); }
protected void Page_Load(object sender, EventArgs e) { Dictionary <string, string> param = PluginBuilderFactory.getProperties(Request); PluginBuilder pb = PluginBuilderFactory.newPluginBuilder(Request, Response); AccessProvider accessProvider = pb.getAccessProvider(); if (accessProvider != null && !accessProvider.requireAccess()) { return; } // 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 r = pb.getConfiguration().getJavaScriptConfigurationJson(); this.Response.Write(r); }