469,287 Members | 2,590 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,287 developers. It's quick & easy.

ExceptionConverter:* java.io.IOException*: The document has no pages

tramalingam
Hello
I am using iText framework.
Getting the following error. The error is occurring when documet.close() is invoked.

ExceptionConverter:* java.io.IOException*: The document has no pages.
at com.nri.xenos.repor*t.text.pdf.PdfPages.*writePage Tree(PdfPag*es.java:107)
at com.nri.xenos.repor*t.text.pdf.PdfWriter*.close(Pd fWriter.jav*a:850)
at com.nri.xenos.repor*t.text.pdf.PdfDocume*nt.close( PdfDocument*.java:1043)
at com.nri.xenos.repor*t.text.Document.clos*e(Documen t.java:497)*

What is the meaning of this?
How shall I overcome it?
please help me.

Regards
Thiru
Oct 8 '07 #1
5 10675
r035198x
13,262 8TB
Hello
I am using iText framework.
Getting the following error. The error is occurring when documet.close() is invoked.

ExceptionConverter:* java.io.IOException*: The document has no pages.
at com.nri.xenos.repor*t.text.pdf.PdfPages.*writePage Tree(PdfPag*es.java:107)
at com.nri.xenos.repor*t.text.pdf.PdfWriter*.close(Pd fWriter.jav*a:850)
at com.nri.xenos.repor*t.text.pdf.PdfDocume*nt.close( PdfDocument*.java:1043)
at com.nri.xenos.repor*t.text.Document.clos*e(Documen t.java:497)*

What is the meaning of this?
How shall I overcome it?
please help me.

Regards
Thiru
Well, the error message says "the document has no pages" doesn't it?
That is supposed to be a vital piece of information.
Oct 8 '07 #2
Well, the error message says "the document has no pages" doesn't it?
That is supposed to be a vital piece of information.
There are pages in that particular document.Still i'm getting the error message.
Oct 8 '07 #3
r035198x
13,262 8TB
There are pages in that particular document.Still i'm getting the error message.
Your word against the computer's now.

Care to post the code? And please make sure you use code tags for posting it.
Oct 8 '07 #4
Your word against the computer's now.

Care to post the code? And please make sure you use code tags for posting it.
Thirs is what the code:

import com.lowagie.text.pdf.PdfReader;
import com.lowagie.text.Document;
import com.lowagie.text.pdf.PdfImportedPage;
import com.lowagie.text.pdf.PdfCopy;
import com.lowagie.text.pdf.PdfStamper;
import com.lowagie.text.pdf.AcroFields;
import com.lowagie.text.DocumentException;
import com.lowagie.text.pdf.PdfWriter;
import com.lowagie.text.Anchor;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.*;
import java.util.*;
import java.util.regex.*;
import java.rmi.RemoteException;

//extends Object;
//implements DocListener;
public class Document1{
// creation of the document with a certain size and certain margins
public static void main(String[] args) {
Document document = new Document();

try {
// creation of the different writers
PdfWriter pdf = PdfWriter.getInstance(document,
new FileOutputStream("C:/Documents and Settings/TRamalingam/Desktop/HelloWorldPdf.pdf"));
// we add some meta information to the document
document.addSubject("This is the result of a Test.");

// we open the document for writing
document.open();
Anchor pdfRef = new Anchor("see Hello World in PDF.");
}
catch(DocumentException de) {
System.err.println(de.getMessage());
}catch (IOException ioe) {
System.err.println(ioe.getMessage());
}
document.close();
}
}
Oct 8 '07 #5
r035198x
13,262 8TB
So you've ignored my remark about having to use code tags?

Here is the link to the itext tutorial.
Oct 8 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by java_helloworld | last post: by
2 posts views Thread by Ed Suominen | last post: by
reply views Thread by tony vee | last post: by
4 posts views Thread by Dr. Laurence Leff | last post: by
4 posts views Thread by aotemp | last post: by
reply views Thread by Hotice | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.