473,219 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,219 software developers and data experts.

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 11266
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

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

Similar topics

5
by: java_helloworld | last post by:
I am trying to print from an applet using the Java Print API. If I run the applet on appletviewer then things work fine i.e. I am able to get the print out. If I run the applet on a browser then...
2
by: Ed Suominen | last post by:
I'd like to write a Python-based commandline tool that will scan pages with SANE, applying CCITT Group 4 compression during scanning, and produce a single PDF file. I would release it under GPL....
0
by: tony vee | last post by:
Hi I have the following bit of Java code: Document doc = tidy.createEmptyDocument(); //bodyElement is the body element in an HTML Document Node first = bodyElement.getFirstChild(); Node top...
4
by: Dr. Laurence Leff | last post by:
I am writing a Java program to read in XML file, modify some elements slightly, and then write it out. That XML file is prepared in Docbook. It works fine, except that it is disturbing the...
0
by: Greg Stangler | last post by:
Is their a utility in .NET which will convert the Java style code documentation comments: /** * Some java style comments * @param p1 ... * @returns ... */ into the C# style
4
by: aotemp | last post by:
Does anyone know how to detect the version of Java installed? My website has an application that requires java 1.5+ to be installed, basically if the user doesn;t already have it installed I...
4
by: santosh.tripathy | last post by:
We have a requirement where in a java based web application is getting integrated with the existing .net based web pages. The .net based web pages are secured through forms authentication. Is there...
3
by: MSK | last post by:
Hi I am a newbie to ASP.NET and VBScript, currently I am designing a page to show all the mapped drives using client-side scripts.. I want to read all the mapped drive details (name and Remote...
0
by: Hotice | last post by:
Hello all, I want to create a web application for sending booking requests to DHL. I already found a toolkit (http://xmlshippingtest.dhl-usa.com/toolkit/index.html) that uses XML files to send the...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.