Hi,
I am trying to create a pdf doc with images. In order to do this, I
created two servlets:
1. First servlet (riskmap) generates the pdf and html documents.
2. Some imgaes for the pdf and html documents are coming from anothe
servlet (createjpg).
Riskmap servlet generates html and pdf pages separately. The html page is
able to get the images from createjpg servlet(with in <img src> tag I
defined the servlet URL).
For the pdf page in riskmap servlet, I have used getInstance call as
below:
Image iRiskNo = null;
iRiskNo =
com.lowagie.text.Image.getInstance("http://localhost:8080/createjpg/createjpg");
When it runs the above statement, it gives the following error
SEVERE: -->> returning Frame NULL
SEVERE: BaseDialog: owner frame is a java.awt.Frame
In creatjpg servlet, the statements that generate the image are as
follows:
created a bufferedimage and ...
.......
JPEGEncodeParam eP =
JPEGCodec.getDefaultJPEGEncodeParam(bufferedImage);
eP.setQuality(1.0f, true);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
encoder.encode(bufferedImage, eP);
I imported the following classes in createjpg servlet:
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.Color;
import java.awt.Font;
import java.io.*;
import java.io.IOException;
import com.sun.image.codec.jpeg.JPEGEncodeParam;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
import javax.servlet.http.*;
import javax.servlet.*;
import com.sun.image.codec.jpeg.JPEGCodec;
As I mentioned above, the riskmap servlet (pdf objects) does not receive
images from createjpg servlet.
Can someone please let me know how I can troubleshoot/solve this problem?.
Donald Jayawardena (user for iText Questions is donald)
Please consider our environment before printing this email.
WARNING - This email and any attachments may be confidential. If received in
error, please delete and inform us by return email. Because emails and
attachments may be interfered with, may contain computer viruses or other
defects and may not be successfully replicated on other systems, you must be
cautious. Westpac cannot guarantee that what you receive is what we sent. If
you have any doubts about the authenticity of an email by Westpac, please
contact us immediately.
It is also important to check for viruses and defects before opening or using
attachments. Westpac's liability is limited to resupplying any affected
attachments.
This email and its attachments are not intended to constitute any form of
financial advice or recommendation of, or an offer to buy or offer to sell, any
security or other financial product. We recommend that you seek your own
independent legal or financial advice before proceeding with any investment
decision.
Westpac Institutional Bank is a division of Westpac Banking Corporation, a
company registered in New South Wales in Australia under the Corporations Act
2001 (Cth). Westpac is authorised and regulated in the United Kingdom by the
Financial Services Authority and is registered at Cardiff in the United Kingdom
as Branch No. BR 106. Westpac operates in the United States of America as a
federally chartered branch, regulated by the Office of the Comptroller of the
Currency.
Westpac Banking Corporation ABN 33 007 457 141.------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/