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

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









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
Problem while using a HashMap for writing text ina RTF file. - Framework
access image from ajax store in mysql using jsp
How to wrap image in the pdf file
how to retrieve the id value itself from the access database to drop down listbox in jsp
how to create pdf file using java and itextjar
how to create pdf file using java and itextjar
how to store image in folder and stored image path in mysql database using JSP
How to store user name,city,state,image path into database and image into folder using jsp
How to insert image in PDF file in struts2
How can store image in server folder when deployed with a .war file?
Image name,image path into database and image into folder using jsp
accessing data from a json file writing javascript or using jQuery
how to upload a file of apk format in a folder from servlet
How to insert a single page PDF file into another multipage PDF file using iText? - Java Beginners
how to fetch image from mysql using jsp
copy file from folder to folder - Java Beginners
How to generate pdf file on click of the links using jsp..
How to generate the pdf file using jsp - JSP-Servlet
display multiple image file or pdf file in multiple column of a row from server or database
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
how to get the image path when inserting the image into pdf file in jsp - JSP-Servlet
how to get the image path when inserting the image into pdf file in jsp - JSP-Servlet
Delete image from folder - JSP-Servlet
how to set the image and address in single row when genearting pdf fil from jsp - JSP-Servlet
Delete image from folder - JSP-Servlet
Java- Save Image into project folder in web application
how to add the scrollbar to the pdf page when generating the pdf file from jsp - JSP-Servlet
How to Open Picture From M.S. Access Database using Java Servlet ?
how to generate PDF file using JSP with net beans
Inserting image in the pdf file
How to delete the row from the Database by using while loop in servlet
how to access the messagresource.proprties filevalues in normal class file using struts - Struts
Direct Access of PDF
ModuleNotFoundError: No module named 'django-random-image-from-folder'
ModuleNotFoundError: No module named 'django-random-image-from-folder'
How to access Contacts from gmail using LDAP in JSP dropdown list
How display a Image on Servlet from file upload - JSP-Servlet
How to insert image in sql database from user using servlet
How To Display both image and data into Swing JTable which is retrieved from ms access database
Rotating image in the pdf file
How to display image in jsp from database using Servlet?
How to retrieve image from database using jsp and servlet?
Image is in same folder where the java file is located - Swing AWT

Ads