<%@language = "javascript" %>
<% /*
    $Revision$
    $Id$

    File:           shared/qrcode.asp
    Parameters:
        text        De text
        -- optioneel --
        version     -1 is auto of 1-40
        autoextend  1 is ja, 0 is nee
        level       error level 0=7%, 1=15%, 2=25%, 3=30%
        masking     masking algoritme -1 is auto of 0 to 7
        size        pixels/module, default 8
*/ %>

<%
DOCTYPE_Disable = true;
var FCLTEXPIRES = 8*60; // 8 uur kan al flink schelen
%>
<!-- #include file="../Shared/common.inc" -->
<%
var xc = Server.CreateObject("SLNKDWF.QRCode");
var proto = (Request.ServerVariables("SERVER_PORT") == "443")?"https":"http";
var sitenoroot = proto + "://" + Request.ServerVariables("SERVER_NAME");
var site = sitenoroot + rooturl;

xc.Text       = site + getQParam("text");
xc.Version    = getQParamInt("version", -1);
xc.Autoextend = getQParamInt("autoextend", 1)==1;
xc.Level      = getQParamInt("level", 1);
xc.Masking    = getQParamInt("masking", -1);
xc.Size       = getQParamInt("size", 8);
xc.Color      = getQParamInt("color", S("qr_color"));
//xc.Logo       = getQParamInt("logo", "FACILITOR");
//xc.LogoSize   = getQParamInt("logosize", 0);

// unsafe Response.AddHeader("QRCode",xc.Text);

Response.clear;
Response.contenttype = "image/png";
Response.BinaryWrite(xc.GetAsPNG());
%>