<%@ Page Language="C#" %>
<%
    WfrLib.PdfServer wfrPdf;
    byte[] pdfImg;

    try
    {

        //PDF Serverのオブジェクトを作成
        wfrPdf = WfrLib.PdfServer.CreateObject("localhost");

        try
        {

            //帳票定義ファイル(*.wfr)のオープンとデータの入力
            wfrPdf.Open(Server.MapPath("sample.wfr"));
            wfrPdf.Import("Data1", 0, Server.MapPath("sample.csv"));

            //PDFイメージの取得とクライアントへの出力
            pdfImg = wfrPdf.GetPdfImage();
            Response.ContentType = "application/pdf";
            Response.BinaryWrite(pdfImg);
        }
        catch (Exception ex)
        {

            Response.Write(ex.Message);
        }

        //破棄
        wfrPdf.Dispose();
    }
    catch (Exception ex)
    {

        Response.Write(ex.Message);
    }
%>