My requirement is to develop an app using IBM Worklight 6.1 which will get the file from web server and show it to the user without downloading it.
For that i did the following steps:-
- First Created an Worklight Project
- In that project created an java package and trying to access the PDF file from Apache Tomcat.
- I am using PDFBOX to read the file from Apache tomcat.
- I am going to receive the PDF text from adapter.
- From the adapter, i am going to send it to the client side and showing to the user.
I followed the following link to generate JAVA code:
http://www.ehow.com/how_6582916_read-pdf-file-java.html
The code is as follows:-
public static String sendPDF(){
PDFTextParser pdf = new PDFTextParser("path to pdf in tomcat");
return pdf.getParsedText();
}
Now the problem is:-
Using this path "path to pdf file in tomcat" the pdfbox is unable to access the file. I am trying to use servletcontext, so i included servlet-api.jar. Still i am unable to access the pdf file. I need a way to access the file. Thanks in advance