Is it possible to convert a PDF file to cv::Mat
?
I know that PDF file is generally vector of objects, but given a required resolution. Is there any tool that can do such a conversion?
Can OpenCV read PDF? OpenCV doesn't support pdf format at all, so you should convert pdf page to image using another library.
Open a PDF file containing a scanned image in Acrobat for Mac or PC. Click on the “Edit PDF” tool in the right pane. Acrobat automatically applies optical character recognition (OCR) to your document and converts it to a fully editable copy of your PDF. Click the text element you wish to edit and start typing.
Using pytesseract, one can extract almost all the data irrespective of the format of the documents (whether its a scanned document or a pdf or a simple jpeg image). Also, since its open source, the overall solution would be flexible as well as not that expensive.
OpenCV doesn't support pdf format at all, so you should convert pdf page to image using another library. Read this discussion: Open source PDF library for C/C++ application?
Also this question is similar to yours: What C++ library can I use to convert a PDF to an image on windows?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With