Title: Message

[Public - disclosed]

Hi there,
 
I'm testing your library which I find it very nice.
The problem is when I try to use XML.
 
I've wrote down the following JSP code:
 
----------------------------- xml2pdf.jsp ---------------------------------
 
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.awt.Color" %>
<%@ page import="com.merck.ptli.utils.*" %>
<%@ page import="com.lowagie.text.*" %>
<%@ page import="com.lowagie.text.pdf.*" %>
<%@ page import="com.lowagie.text.xml.*" %>
<%@ page import="javax.xml.parsers.*" %>
 
<html>
<head><title>Making PDF files test</title></head>
<body>
 
<%
    // Create objects
    Document pdfDoc = new Document(PageSize.A4,48,32,32,32);
    Date docStamp = new Date();
    String docURL = "/documents/pdf/" + docStamp.getTime() + ".pdf";
    String docPath = appinfo.stGetHtmlPath() + docURL;
    PdfWriter.getInstance(pdfDoc, new FileOutputStream(docPath));
    SAXParser xmlParser = SAXParserFactory.newInstance().newSAXParser();
    try {
        xmlParser.parse("http://myserver/xmldata/doctemplates/teste.xml
", new SAXiTextHandler(pdfDoc));
    }
    catch (Exception e) {
        out.println("<p>" + e.toString() + "</p>");
        return;
    }
 
%>
 
<script language='_javascript_1.2'>
    location.href='';
</script>
 
</body>
</html>
 
 
The XML file contains the following simple data:
 
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ITEXT SYSTEM "http://itext.sourceforge.net/itext.dtd">
<itext creationdate="Seg 19 JUL 2004" producer="Carlos Santos">
 <chunk font="Helvetica" size="12.0" fontstyle="normal, underline" red="128" green="128" blue="255">XML TEST</chunk>
</itext>
 
 
Then, when I try to run the JSP file it takes a long time to execute, but I catch the following exception:
java.net.ConnectException: Connection timed out
 
I tried to use the code, adapted to a JSP servlet, of your example in the tutorial (Chap0701.java and Chap0701.xml) and it did'nt work either.
The same error was caught!
 
Platform:
OS: Red Hat Linux AS 2.1
Web server: Apache 1.3
Servlet engine: Tomcat 4.0.4
 
Thanks in advance,
Carlos Santos
Systems Engineer Web Developer
MSD Portugal - IT Department
 Intranet & E-Initiatives

'    +351 21 446 5774
È   +351 96 852 0488
.   [EMAIL PROTECTED]

 

------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.
------------------------------------------------------------------------------

Reply via email to