Alley in Pisa, Italy

by Lars Kotthoff

submit your photo


Hall of Fame
View past winners from this year

Please participate in Meta
and help us grow.

Take the 2-minute tour ×
Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It's 100% free, no registration required.

I have a pdf file which is a pdf format of a newspaper page that has many articles(image + text), same as the articles we find in the newspaper that newspaper vendor drops at our place everyday.

I wanted to ask if its possible to slice those articles from that pdf file somehow, pro-grammatically by using a library or using a tool?

If not pdf then is it possible slice those articles from that image file?

share|improve this question

closed as off-topic by Paul Cezanne, AJ Henderson, Dan Wolfgang, mattdm, Michael Clark Sep 10 '13 at 17:21

  • This question does not appear to be about photography within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Welcome to photo.stackexchange. I've answered but I think this will be closed as off-topic. –  Paul Cezanne Sep 10 '13 at 16:22
4  
This question appears to be off-topic because it is about manipulating a PDF file, not about photography. –  Paul Cezanne Sep 10 '13 at 16:22

1 Answer 1

up vote 1 down vote accepted

Yes it is.

Ok, now how? Man, that's rough. At a former job I helped maintain and expand our PDF parser. PDF is a computer language for specifying page layout and content. So all the data you need is in there but it would be a big task to automate it.

Then again, if you only need to do this to a small number of PDFs you could hope that the text is actually text, not image data, and see if copy/paste work.

(Now, with that said, I do hope that you have permission of the copyright holder to do this if you intend to re-distribute the articles.)

share|improve this answer
1  
OCR software - Optical Character Recognition is done on images containing text. Result is a text file. –  Esa Paulasto Sep 10 '13 at 16:32
    
@Paul Thanks for reply, I mentioned photo or pdf as the source given to me could be in either format. The text that is there in the pdf/photo is in Hindi language. Could you suggest how could I achieve slice those articles from a pdf/photo? I mean to ask technology I will need to understand or libraries if any I will have to use. Any resources will be helpful. Thanks for the reply again. –  skip Sep 10 '13 at 16:32
1  
Sadly, all that work was for a former employer. The good news is that the PDF spec is public, so you can write a parser. The bad news is that the spec is huge. PDF is written in Postscript so any Postcript parser should work, but I think unless you find an open source package you'll have your work cut out for you. –  Paul Cezanne Sep 10 '13 at 17:15
1  
See podofo.sourceforge.net, I don't know anything about it, it was the first google hit on my search. –  Paul Cezanne Sep 10 '13 at 17:16
    
I use github.com/yob/pdf-reader to do automated testing against PDFs I generate. It is not a command line tool, but rather a (ruby) library. –  Patrick Hurley Sep 10 '13 at 19:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.