0

This is a modified question on this link Extract images with podofo from pdf pages

The above link shows how to identify images by page wise.

I need to know how to get only the image coordinated i.e it's (x,y) point and width and height instead of extracting.

Can any one let me know how do i get that?

Scheff's Cat
  • 19,528
  • 6
  • 28
  • 56
senthil
  • 21
  • 4
  • Please read [the help pages](http://stackoverflow.com/help), especially ["What topics can I ask about here?"](http://stackoverflow.com/help/on-topic) and ["What types of questions should I avoid asking?"](http://stackoverflow.com/help/dont-ask). Also [take the tour](http://stackoverflow.com/tour) and [read about how to ask good questions](http://stackoverflow.com/help/how-to-ask) and [this question checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/). Lastly learn how to create a [mcve]. – Some programmer dude Jan 18 '19 at 09:07
  • I followed your link and googled a bit (out of curiosity) which brought me to [`ImageExtractor::ExtractImage()`](https://searchcode.com/file/18075907/podofo-0.9.1/tools/podofoimgextract/ImageExtractor.cpp). Here, you find `pObject->GetDictionary().GetKey( PdfName("Width" ) )->GetNumber()` and `pObject->GetDictionary().GetKey( PdfName("Height" ) )->GetNumber()`. About x, y - no idea. (I must admit that I've no experience with PDF nor PoDoFo except having used the former as mere user and heard about the latter by name.) – Scheff's Cat Jan 18 '19 at 09:25
  • Concerning x, y, it might (or may not) be a bit more complicated. I would be afraid that objects might be shared and actual appearance on a page might be stored separately. I'm afraid to answer this it's necessary to know about the general structure of PDF and how it's reflected in PoDoFo. I could imagine that positions are not necessary be stored at the image object itself but instead where it is referred to place it in page contents. I could imagine also that x, y coordinates are a basic feature of any page object. But, that's all mere guessing... – Scheff's Cat Jan 18 '19 at 09:32
  • The same is possible in python or c#. so definitely there should be a solution in c++ too. I am searching that now. pObject->GetDictionary().GetKey( PdfName("Width" ) )->GetNumber() and pObject->GetDictionary().GetKey( PdfName("Height" ) from the pdfObject we will be able to get the content of the image and also it;s width and height, but i'm not worried about the content as long as it is an image. i only need the image region or it's bounding box. since I have the width and height. i only need to know what is the starting point (x,y) of the image in the page. – senthil Jan 18 '19 at 10:18

0 Answers0