<%@page import="java.io.*, javax.servlet.*, com.pdflib.pdflib" %><%

   /* $Id: hello.jsp,v 1.1.2.3 2002/01/28 17:28:25 rp Exp $
    *
    * hello.jsp
    */

    int font;
    pdflib p;
    byte[] buf;
    ServletOutputStream output;

    p = new pdflib();
    p.open_file("");

    p.set_info("Creator", "hello.jsp");
    p.set_info("Author", "Rainer Ploeckl");
    p.set_info("Title", "Hello world (JSP)");

    p.begin_page(595, 842);

    /* Change "host" encoding to "winansi" or whatever you need! */
    font = p.findfont("Helvetica-Bold", "host", 0);

    p.setfont(font, 18);

    p.set_text_pos(50, 700);
    p.show("Hello world!");
    p.continue_text("(says java-JSP)");
    p.end_page();
    

    p.close();
    buf = p.get_buffer();

    response.setContentType("application/pdf");
    response.setContentLength(buf.length);

    output = response.getOutputStream();
    output.write(buf);
    output.close();
%>
