The type Font is ambiguous where generating pdf file from jsp page
I am geeting ambiguous error .Do u want to add any jar files
<%@page import="java.io.*"%>
<%@page import="java.awt.*"%>
<%@page import="com.lowagie.text.*"%>
<%@page import="com.lowagie.text.pdf.*"%>
<%
try {
Document document=new Document();
Font headFont = FontFactory.getFont(FontFactory.HELVETICA, 10,
Font.BOLD, new Color(255, 255, 255));
PdfWriter.getInstance(document,new FileOutputStream("C:/hello.pdf"));
document.open();
Table datatable = new Table(1);
datatable.addCell(new Phrase("Screen", headFont));
document.add(datatable);
document.close();
}
catch (Exception e2) {
System.out.println(e2.getMessage());
}
%>
View Answers
February 22, 2010 at 12:09 PM
Hi Friend,
Import the class Font into your JSP page like the following:
<%@page import=" com.lowagie.text.Font"%>
Thanks
Ads
Related Tutorials/Questions & Answers:
Advertisements
pdf file in jsp
pdf file in jsp i have a
pdf, which has to be displayed in a
jsp page along with some html tags, the
pdf which is to be displayed shold be readonly and wont allow the uer to save too
pdf generate from jsp
pdf generate
from jsp how do i generate a
pdf using
jsp that should query the data
from the database and write it into a
pdf and download the same
write data to a pdf file when i run jsp page
write data to a
pdf file when i run
jsp page Hi,
<%@
page import... to the libraries.the
pdf file are not opened when i execute the program.please send the code to open the
pdf file when i execute the
jsp page
write data to a pdf file when i run jsp page
write data to a
pdf file when i run
jsp page Hi,
<%@
page import... to the libraries.the
pdf file are not opened when i execute the program.please send the code to open the
pdf file when i execute the
jsp page
write data to a pdf file when i run jsp page
write data to a
pdf file when i run
jsp page Hi,
<%@
page import... to the libraries.the
pdf file are not opened when i execute the program.please send the code to open the
pdf file when i execute the
jsp page
write data to a pdf file when i run jsp page
write data to a
pdf file when i run
jsp page Hi,
<%@
page import... to the libraries.the
pdf file are not opened when i execute the program.please send the code to open the
pdf file when i execute the
jsp page
Generate pdf file - JSP-Servlet
Generate
pdf file
Hi Friends,
How to generate the
pdf file for the
jsp page or in servets Hi Friend,
You need to download itext api. After that set the classpath and try the following code
Generating pdf in Spring
Generating pdf in Spring Sir/Madam,
I need your help in
generating a
pdf by fetching the data form database and by using unicode in spring framework
how to generate the pdf report from jsp
want to generate the
pdf file from jsp page.I add the itext.jar to the libraries...how to generate the
pdf report
from jsp <%@
page import... not getting the
pdf file.Any one please help me asap.Its very important
openning the pdf or doc file in same jsp
openning the
pdf or doc
file in same
jsp **how to open the
pdf and doc
file in same
jsp after clicking the link or button (which is with out moving to the next
page). will some body help me on this @simple format please
Generate unicode malayalam PDF from JSP
Generate unicode malayalam
PDF from JSP Hi,
I want to generate a malayalam report in
PDF format.I have generated a report in jsp.Now I want... a simple
pdf generator code using itext api.
Try this:
<%@
page import="java.io.
Retrieve data from databse using where in JSP
Retrieve data
from databse using
where in JSP Hi, can somebody help me?
I have a
jsp page. in that i want to get data
from the database
where...=request.getParameter("username");
String sql;
sql="SELECT *
FROM register
WHERE
how to give link from jsp to jsp page
how to give link
from jsp to
jsp page hi this is my following code...:3306/test", "root", "root");
String query = "select *
from employee
where id...="+str+"&id="+id;
}
}
Delete is my servlet
file and other servlet
how to give link from jsp to jsp page
how to give link
from jsp to
jsp page hi this is my following code...:3306/test", "root", "root");
String query = "select *
from employee
where id...="+str+"&id="+id;
}
}
Delete is my servlet
file and other servlet
Adding Image to Header and footer at generating Itext PDF
to add Image to Header , am
generating the
PDF letter
am able to add the text...("This is
page: ", new
Font(bf_courier)), true);
header.setAlignment(Element.ALIGN_CENTER... Phrase(
"This is
page: ", new
Font(bf_courier)), true);
footer.setBorder