How to access the image file from project folder itself while writing to pdf using itext?

Ads
 

How to access the image file from project folder itself while writing to pdf using itext?

I am writing a pdf using itext where i add a image in the beginning of the document. When i use

image = Image.getInstance("C:\\company.jpg");

it works fine But when i use this code

image = Image.getInstance("items\\company.jpg");

it doesnt work.How do i accomplish that task? It tries to search for the image in the domain folder of the glassfish location.But i want it to pick it up from the project folder itself.Because later i deploy the project in a linux server where i cannot give a path of windows.So please help me accomplish this.I am using simple java program to write the pdf.Not a servlet.Thanks

View Answers

Ads









Related Tutorials/Questions & Answers:
How to access the image file from project folder itself while writing to pdf using itext?
How to copy an jpeg image from one folder to other folder using jsp
Advertisements
How to copy an jpeg image from one folder to other folder using jsp
how to download a file from a folder??
how can i open pdf file in assest folder in android application?
how to store image file and videofile in ms access database using java? - JDBC
How to wrap image in the pdf file
how to create pdf file using java and itextjar
how to create pdf file using java and itextjar
how to retrieve the id value itself from the access database to drop down listbox in jsp
How can store image in server folder when deployed with a .war file?
How to insert image in PDF file in struts2
Problem while using a HashMap for writing text ina RTF file. - Framework
access image from ajax store in mysql using jsp
how to upload a file of apk format in a folder from servlet
How to store user name,city,state,image path into database and image into folder using jsp
how to store image in folder and stored image path in mysql database using JSP
how to fetch image from mysql using jsp
How to generate the pdf file using jsp - JSP-Servlet
How to insert a single page PDF file into another multipage PDF file using iText? - Java Beginners
Image name,image path into database and image into folder using jsp
How to generate pdf file on click of the links using jsp..
how to generate the pdf file with scroolbar from jsp age - JSP-Servlet
How I can filling pdf file that crated by livecycle using itext
Java- Save Image into project folder in web application
how to set the image and address in single row when genearting pdf fil from jsp - JSP-Servlet
how to get the image path when inserting the image into pdf file in jsp - JSP-Servlet
accessing data from a json file writing javascript or using jQuery
copy file from folder to folder - Java Beginners
how to get the image path when inserting the image into pdf file in jsp - JSP-Servlet
how to add the scrollbar to the pdf page when generating the pdf file from jsp - JSP-Servlet

Ads