I am trying to extract all datas( such as square ,rect,line etc.,) from a pdf document which was generated using iText.But I'm not able extract the content rather than text and image.I want to extract graphical components mentioned above.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
There seem to be 3 options for this (at least those are the ones I could find), I do not know what you exactly have, so I will paste all the 3, these are in increasing levels of difficulty)
First Option: You could do something like so: (taken from here)
Second option could be to convert your PDF document to HTML, using something along the lines of what is shown here and then, use
JSoup
to process the HTML and iterate over theimg
tags, which is how I am assuming that the images will be rendered.Alternatively, you could take a look at the
Hough Transform
:An imaging library, such as
OpenCV
should be able to yield such functionality out of the box (OpenCV-Java
) being a Java wrapper for such library.This example should point you in the right direction.