Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Challenging Issue

 
Frederik Ericsson
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Guys,

I would like to read a file(TIF or pdf or word) through stream, I know that's easy but what I want to do is, read the file
find the no of pages, lets say total of 5 pages, I want to get 3 - 5 pages through the sream and I have to put it in the view
Using only Sun Java API nothing other then this, NoT aspire or apache or anything.. thats the crieteria here.

this might be the challenging issue GUYS!!!

Please help me out in this. I really appreciate it.
[ April 20, 2007: Message edited by: Bear Bibeault ]
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is nothing in the Java SE API which parses TIF's, PDF's or DOC's, much less identifies pages or displays said file formats.
If you decide to branch out from using the Java API, have a look at our Accessing File Formats page. There are some tools there that may help you.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The standard Java class libraries have nothing that would help with this. Libraries like POI (for Word), iText (for PDF) and JIMI (for TIFF) can do this - why would you want to reinvent the wheel?
 
Frederik Ericsson
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeo n Ulf,

My company does nt want to use any of those except java class libraries. I dont know what am going to do.
 
Frederik Ericsson
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeo n Ulf,

I would like to ask you guys something, am planning to implement it using stream and reading through bytes, for the page count, I have to check the page seperators, do you know how to do that while reading the bytes.

If I can able to get the value of seperator then, I can count and seperate the page easily, can you guys please help me.
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page seperators don't necessarily occur in-line, or exist in the file at all. The "end" of a page may determined on-the-fly depending on the currently selected printer, physical page size, the existance of hard "page break" characters, amount, size and format of content and so on, and this will be different with each file format.
TIFF is at least an open standard. DOC and PDF aren't known for their extensability, but you can start by downloading the dozen or so different file spec's here.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My company does nt want to use any of those except java class libraries.


That's ridiculous. One of the major benefits of Java is the availability of a large number of high quality open source libraries. Making their developers reinvent the wheel will cost them a ton of money.
 
rubbery bacon. rubbery tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!