Share on Google+Share on Google+

pradeep
The type Font is ambiguous where generating pdf file from jsp page
1 Answer(s)      7 years ago
Posted in : JSP-Servlet
I am geeting ambiguous error .Do u want to add any jar files


<[email protected] import="java.io.*"%>
<[email protected] import="java.awt.*"%>
<[email protected] import="com.lowagie.text.*"%>
<[email protected] 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());
}
%>

Ads

View Answers

February 22, 2010 at 12:09 PM


Hi Friend,

Import the class Font into your JSP page like the following:

<[email protected] import=" com.lowagie.text.Font"%>

Thanks









Related Tutorials/Questions & Answers:
The type Font is ambiguous where generating pdf file from jsp page - JSP-Servlet
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   Hi Friend, Import the class Font into your JSP page like the following
The type Font is ambiguous where generating pdf file from jsp page - JSP-Servlet
The type Font is ambiguous where generating pdf file from jsp page  i am getting the type font is ambiguous and type imgae ambiguous ? document.open(); 32: Font headFont = FontFactory.getFont(FontFactory.HELVETICA
Advertisements
how to add the scrollbar to the pdf page when generating the pdf file from jsp - JSP-Servlet
how to add the scrollbar to the pdf page when generating the pdf file from jsp  I am not able to see all the columns when i generated the pdf file from jsp.i have 12 colums so how to add the scrollbar
How to set the pdfptable as pdf page header when generating the pdf from jsp page. - JSP-Servlet
How to set the pdfptable as pdf page header when generating the pdf from jsp page.  how to set the pdfptable column headers as a header of the documet.i need to display the column headers for every pdf page if pdf documt is 20
how to add the two tables in same row when generating pdf file from jsp - JSP-Servlet
how to add the two tables in same row when generating pdf file from jsp  How to add the two tables in same row one is left side and other is right side please help me.   Hi Friend, Try the following code
open pdf file in same jsp page and the pdf file should retrieved from database
open pdf file in same jsp page and the pdf file should retrieved from database  Hai all, I need code to open a pdf file in same jsp page(browser) while click on hyperlink And the file was located in database table. Can any
Generating PDF reports - JSP-Servlet
Generating PDF reports  Hello everyone i have submitted several... Question I am try to generate a pdf report using jsp .... i want to export.../itext/helloServletPDF.shtml http://www.roseindia.net/jsp/file_upload
writing document (.doc) file from java with format such as font type, font style
writing document (.doc) file from java with format such as font type, font... with format such as font type and style to a document file? Thanks in advance... WriteInDocument{ public static void main(String[] args)throws IOException{ File file
generating itext pdf from java application - Java Beginners
generating itext pdf from java application  hi, Is there any method in page events of itext to remove page numbers from pdf generated frm java application.  Hi friend, Read for more information. http
how to generate the pdf file with scroolbar from jsp age - JSP-Servlet
how to generate the pdf file with scroolbar from jsp age  How to generate the pdf file with scroolbar from jsp.i am not able to see the all the columns in pdf file now .it is very urgent for me plz help
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
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
query regarding exporting table from jsp page to pdf
query regarding exporting table from jsp page to pdf  hello i am displaying one table on my jsp page and i want to save that table in pdf file can u...;td>Address</td></tr> <tr><td><input type
query regarding exporting table from jsp page to pdf
query regarding exporting table from jsp page to pdf  hello i am displaying one table on my jsp page and i want to save that table in pdf file can u...;td>Address</td></tr> <tr><td><input type
query regarding exporting table from jsp page to pdf
query regarding exporting table from jsp page to pdf  hello i am displaying one table on my jsp page and i want to save that table in pdf file can u...;td>Address</td></tr> <tr><td><input type
query regarding exporting table from jsp page to pdf
query regarding exporting table from jsp page to pdf  hello i am displaying one table on my jsp page and i want to save that table in pdf file can u...;td>Address</td></tr> <tr><td><input type
query regarding exporting table from jsp page to pdf
query regarding exporting table from jsp page to pdf  hello i am displaying one table on my jsp page and i want to save that table in pdf file can u...;td>Address</td></tr> <tr><td><input type
query regarding exporting table from jsp page to pdf
query regarding exporting table from jsp page to pdf  hello i am displaying one table on my jsp page and i want to save that table in pdf file can u...;td>Address</td></tr> <tr><td><input type
query regarding exporting table from jsp page to pdf
query regarding exporting table from jsp page to pdf  hello i am displaying one table on my jsp page and i want to save that table in pdf file can u...;td>Address</td></tr> <tr><td><input type
pdf file is having the 0 KB when generate the pdf file from jsp - JSP-Servlet
pdf file is having the 0 KB when generate the pdf file from jsp  Hi Friend, I am getting OKB pdf file .if i inserting the image into pdf file , i am getting the OKB pdf file now and also not able to open the pdf
query regarding exporting table from jsp page to pdf
query regarding exporting table from jsp page to pdf  hello i am displaying one table on my jsp page and i want to save that table in pdf file can u...;td>Address</td></tr> <tr><td><input type
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
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
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
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
How to read and display data from a .properties file from a jsp page
How to read and display data from a .properties file from a jsp page  I have a .properties file. I have to create a jsp page such that it reads the data from this .properties file and display it in table format. Ex:by using
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
How to insert a single page PDF file into another multipage PDF file using iText? - Java Beginners
How to insert a single page PDF file into another multipage PDF file using iText?  Hi ALL: I have two PDF files. PDF-A.pdf is a multipage PDF file. PDF-B.pdf is a single page PDF file. I want to insert PDF-B into PDF-A only
Tutorials   
Java Spring Hibernate Struts Training fat image from db fat image from db fat image from db fat image from db unable to get value returned from javascript variable in page How to change image size before adding to mysql using jsp Design a registration.jsp page with input for user registration details Cart Quantity jsp servlet coding issue servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? image pdf marking pdf marking Multiple image upload using JSP Read code from excel sheet and upload into database using JSP Student java about search engine Convert BLOB to PDF and save it to a location how to copy files from remote to local machine using SFTP SSL in java? Like Team viewer Socket and Servert -Jsp how to copy files from remote location to local using java? How To Store Multilple Images In MySQL database dynamically with image uploader and then retrieve them in image gallery using java how to create SOAP based web service in java? how to fetch data from mysql database table and draw a bar chart on that data using in jsp how to create users in LDAP using java? how to authenticate user using TIVOLI api in java? how to create users using IBM Tivoi API in jsp/servelet? Java/J2ee Please explain this code as many packages and classes are unknown to me .! how to download the uploaded folder files using jsp Login Query image is display from path of mysql database please reply the code to store dynamic fields in database? Reloading issue in jsp How to get Button Id ? calling one jap page from another jsp page login login Problem to get connection from DAO class to JDBC Page Loading Time Fix table's column's name row(1st row of the table) so that it does not move up when the table is scrolled up to view more rows below Sending hidden values

Ads

 
Advertisement null

Ads