• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

how to read pdf file through java API  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one tell me how to read pdf file through java API

I used all jars like pdfbox.jar... but bo use , can any one explain me with code???
BufferedReader br = new BufferedReader(new FileReader("//Summary_RPT_PDF//"+reportname+".pdf"));
if (br.readLine()== null ) {
......
else{
....
}
it showing exception like ...The network path was not found along with file not found exception.
 
Ranch Hand
Posts: 679
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jabi Vulla wrote:"//Summary_RPT_PDF//"+reportname+".pdf"))

it showing exception like ...The network path was not found along with file not found exception.


That would suggest that the file either doesn't exist or is not accessible from the program. Does it exist - the two sets of // in the name look suspicious.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jabi Vulla wrote:Can any one tell me how to read pdf file through java API

I used all jars like pdfbox.jar... but bo use , can any one explain me with code???
BufferedReader br = new BufferedReader(new FileReader("//Summary_RPT_PDF//"+reportname+".pdf"));
if (br.readLine()== null ) {
......
else{
....
}
it showing exception like ...The network path was not found along with file not found exception.



If your file is on the shared network then access it using "\\hostname" + "\\Summary_RPT_PDF\\" + reportname + ".pdf"

If it is on your local drive then access it using "c:\\Summary_RPT_PDF\\" + reportname + ".pdf"
 
Rancher
Posts: 42974
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For starters, PDF files contain binary data, not character data. That means any attempts to deal with them using Readers and Writers won't work - you need to use InputStreams and OutputStreams. Using those it is no problem to read and writ PDF files. But since you mention PDFBox, I'm guessing you want to achieve more than just get at the bytes that make up the file. If you told us what the underlying problem is, maybe we can point you to a more specific direction.
 
What's that smell? Hey, sniff this tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!