Comments (1)
This is somewhat tangential, but you can use the python-poppler
package to achieve this (though admittedly it was a bit unclear at first how to do it).
The code would be something along the lines of:
from poppler import load_from_file
# load the file
pdf = load_from_file("somefile.pdf")
# argument can be either 0-based index or a "page label" (whatever the latter is)
# note that this doesn't really "create" a page (in the sense of modifying the
# original or a copy of the PDF), it simply returns a `Page` object
page = pdf.create_page(0)
# go over the text list
for item in page.text_list():
print(item.bbox.as_tuple(),item.text)
# getting text from some (rectangular) region
from poppler import Rectangle
text_in_region = page.text(Rectangle(x, y, width, height))
from pdftotext.
Related Issues (20)
- Unable to install pdftotext : poppler/cpp/poppler-document.h not found HOT 4
- Crash when PDF contains empty pages HOT 3
- problems reading and maintaining the layout HOT 2
- AttributeError: module 'pdftotext' has no attribute 'PDF' HOT 4
- ImportError: DLL load failed while importing pdftotext: The specified module could not be found
- Import error when running on MacOs (M1) HOT 1
- Enable tests requiring at least version 0.88 if requirement is met HOT 3
- Formatting changed after new install HOT 4
- not able to install in red-hat base image 8 HOT 1
- Can't install using conda/mamba HOT 4
- double column pdf HOT 2
- PDF tags after converting tags from PDF HOT 5
- Poppler/error seen while extracting text from PDF such as poppler/error (572194): Unknown filter 'JPXDecode'\n HOT 2
- I am getting this issue in python 3.7.7 macosm2
- Getting error Invalid ToUnicode Cmap HOT 2
- Can't make crop work HOT 1
- #17 in arch linux HOT 9
- Not exactly an issue HOT 1
- Unable to install HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdftotext.