Make a search in the mailing list for "Helvetica not found as resource".
Best Regards,
Paulo Soares
----- Original Message -----
From: "Peter Zhou" <[EMAIL PROTECTED]>
To: "Paulo Soares" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Monday, August 19, 2002 2:55
Subject: Re: [iText-questions] Open PDF-file error: it has no pages
> Dear Paulo,
>
> Let me explain the error more in detail. Here is the JSP (test.jsp) code:
>
> <%@ page contentType="text/html;charset=UTF-8" pageEncoding="iso-8859-1"
%>
> <%@ page import="java.io.*" %>
> <%@ page import="com.lowagie.text.*,com.lowagie.text.pdf.*" %>
> <html>
> <head>
> <title>TEST</title>
> </head>
> <body>
>
> <p>
> <FONT SIZE="+2">Ohhh It is a test!</font>
> </p>
> <%
>
>
> // step 1: creation of a document-object
> Document document = new Document();
>
> try {
>
> // step 2:
> // we create a writer that listens to the document
> // and directs a PDF-stream to a file
>
> PdfWriter.getInstance(document, new
FileOutputStream("test3.pdf"));
>
> // step 3: we open the document
> document.open();
>
> // step 4: we add a paragraph to the document
> document.add(new Paragraph("Hello World"));
>
> }
> catch(DocumentException de) {
> System.err.println(de.getMessage());
> }
> catch(IOException ioe) {
> System.err.println(ioe.getMessage());
> }
>
> // step 5: we close the document
> document.close();
> %>
> </body>
> </html>
>
>
> The web sever is JRUN4. After I try to open this test.jsp page, JRUN gives
this error message:
> Helvetica not found as resource.
> Error: Helvetica not found as resource.
> And Internet Explorer gives no error. When I try to open the generated
test3.pdf with Acrobat 5.0,unfortunately Acrobat gives the following error
message:
> There was an error opening this document. This file cannot be
opened because it has no pages
>
> It should be noted that if the sample code is in the form of Java
application, it gives no error, and the generated PDF file can be opened
correctly.
>
> Therefore, my question is what happens to JSP?
>
> Regards,
> Peter
>
>
>
> ----- Original Message -----
> From: "Paulo Soares" <[EMAIL PROTECTED]>
> To: "Peter Zhou" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
> Sent: Friday, August 16, 2002 6:10 PM
> Subject: Re: [iText-questions] Open PDF-file error: it has no pages
>
>
> > Works for me. Are you sure no exception is thrown even in close()?
> >
> > Best Regards,
> > Paulo Soares
> >
> > ----- Original Message -----
> > From: "Peter Zhou" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, August 16, 2002 7:33
> > Subject: [iText-questions] Open PDF-file error: it has no pages
> >
> >
> > > Hi iText developers,
> > >
> > > I try to open the generated PDF file with Acrobat 5.0, but it fails.
The
> > > Acrobat 5.0 gives the following error message:
> > > there was an error opening this document. This file
cannot
> > > be opened because it has no pages
> > >
> > > Here is the code to generate the PDF file:
> > >
> > > // step 1: creation of a document-object
> > > Document document = new Document(PageSize.A4, 50, 50, 50, 50);
> > > try {
> > > // step 2:
> > > // we create a writer that listens to the document
> > > PdfWriter writer = PdfWriter.getInstance(document, new
> > > FileOutputStream("Chap1110.pdf"));
> > > // step 3: we open the document
> > > document.open();
> > > // step 4:
> > > // we add some content
> > > for (int k = 1; k <= 10; ++k) {
> > > document.add(new Paragraph("This document has the
> > > logical page numbers: i,ii,iii,iv,1,2,3,A-8,A-9,A-10\nReal page " +
k));
> > > document.newPage();
> > > }
> > > PdfPageLabels pageLabels = new PdfPageLabels();
> > > pageLabels.addPageLabel(1,
> > > PdfPageLabels.LOWERCASE_ROMAN_NUMERALS);
> > > pageLabels.addPageLabel(5,
> > > PdfPageLabels.DECIMAL_ARABIC_NUMERALS);
> > > pageLabels.addPageLabel(8,
> > > PdfPageLabels.DECIMAL_ARABIC_NUMERALS, "A-", 8);
> > > writer.setPageLabels(pageLabels);
> > > }
> > > catch (Exception de) {
> > > de.printStackTrace();
> > > }
> > >
> > > // step 5: we close the document
> > > document.close();
> > >
> > >
> > >
> > > Thanks in advance
> > > Peter
> > N���隊X��?���u��H3S�����aj?��%uǥ��h�឵��?�y?��i?����'��
(��ڲ���q�����H�{j��-��왨��x%��bM�m�笶*'�X��?��~��zw���i?��l��
�q��?�z���l�X��)ߣ��{j��-��
>
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions