473,411 Members | 2,148 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,411 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 11287
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.