Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f561f3488 | ||
|
|
989de3122e | ||
|
|
20be0aa49e |
No files matched your search
+1
-1
@@ -10,7 +10,7 @@ tests/*.txt
|
|||||||
.idea/
|
.idea/
|
||||||
.vscode
|
.vscode
|
||||||
tests/samples/output
|
tests/samples/output
|
||||||
samples
|
./samples
|
||||||
**__pycache**\
|
**__pycache**\
|
||||||
.mypy_cache
|
.mypy_cache
|
||||||
.ipynb_checkpoints
|
.ipynb_checkpoints
|
||||||
@@ -16,11 +16,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
PDF-Major is a fork of `PDFMiner.six`. It is meant to be a more light-weight implementation that makes fewer assumptions on the data. The ultimate goal of this project is to provide a simpler, faster and more functional library that both casual and low-level developers could build upon.
|
PDF-Major is a **complete re-write** of `PDFMiner.six`. It is meant to be a more light-weight implementation that makes fewer assumptions on the data. The ultimate goal of this project is to provide a simpler, faster and more functional library that both casual and low-level developers could build upon.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
See documentation [here](https://asosnovsky.github.io/pdfmajor/).
|
See [full API documentation here](https://asosnovsky.github.io/pdfmajor/api/).
|
||||||
|
|
||||||
## Basic Example
|
## Basic Example
|
||||||
```py
|
```py
|
||||||
@@ -34,9 +34,9 @@ for page in PDFInterpreter("/path/to/pdf.pdf"):
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Why Another Fork?
|
## Why a re-write?
|
||||||
|
|
||||||
`PDFMiner` was designed to run in python 2.7>, `PDFMiner.six` was written to bring cross-version support for python 2 and 3. However, after attempting to build and extend upon `PDFMiner.six` I found it rather difficult to extend and identify additional details regarding the items encoded in the pdf. This library will attempt to expose as much information as possible to end-users, without having them solely rely on to-xml or to-json exports.
|
`PDFMiner` was designed to run in python 2.7, `PDFMiner.six` was written to bring cross-version support for python 2 and 3. However, after attempting to build and extend upon `PDFMiner.six` I found it rather difficult to extend and identify additional details regarding the items encoded in the pdf. This library will attempt to expose as much information as possible to end-users, without having them solely rely on to-xml or to-json exports.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|||||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
__version__ = (1, 3, 8)
|
__version__ = (1, 3, 9)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print(
|
print(
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from tqdm import tqdm
|
|
||||||
|
|
||||||
from ..parser.PDFPage import PDFPage
|
from ..parser.PDFPage import PDFPage
|
||||||
from ..utils import set_log_level, get_logger, logging
|
from ..utils import set_log_level, get_logger, logging
|
||||||
from .commands.state import PDFStateStack, PDFColorSpace, PREDEFINED_COLORSPACE
|
from .commands.state import PDFStateStack, PDFColorSpace, PREDEFINED_COLORSPACE
|
||||||
@@ -53,7 +51,7 @@ class PDFInterpreter:
|
|||||||
caching=self.caching,
|
caching=self.caching,
|
||||||
check_extractable=self.check_extractable
|
check_extractable=self.check_extractable
|
||||||
)
|
)
|
||||||
for page_num, page in tqdm(enumerate(pages), desc="Reading pages...", disable=self.debug_level > logging.INFO):
|
for page_num, page in enumerate(pages):
|
||||||
self.__pages.append(PageInterpreter(page, page_num, font_cache))
|
self.__pages.append(PageInterpreter(page, page_num, font_cache))
|
||||||
yield self.__pages[-1]
|
yield self.__pages[-1]
|
||||||
log.info(f"Done Reading {len(self.__pages)} pages.")
|
log.info(f"Done Reading {len(self.__pages)} pages.")
|
||||||
@@ -64,7 +62,7 @@ class PDFInterpreter:
|
|||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
if len(self.__pages) > 0:
|
if len(self.__pages) > 0:
|
||||||
set_log_level(self.debug_level)
|
set_log_level(self.debug_level)
|
||||||
for page in tqdm(self.__pages, desc="Reading pages from store...", disable=self.debug_level > logging.INFO):
|
for page in self.__pages:
|
||||||
yield page
|
yield page
|
||||||
set_log_level(logging.WARNING)
|
set_log_level(logging.WARNING)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 576 KiB |
Binary file not shown.
Binary file not shown.
@@ -10,7 +10,7 @@ import sys
|
|||||||
with open('README.md') as readme_file:
|
with open('README.md') as readme_file:
|
||||||
SETUP = {
|
SETUP = {
|
||||||
"name": "pdfmajor",
|
"name": "pdfmajor",
|
||||||
"version": "1.3.8",
|
"version": "1.3.9",
|
||||||
"packages": find_packages(include=['pdfmajor*']),
|
"packages": find_packages(include=['pdfmajor*']),
|
||||||
"install_requires": [
|
"install_requires": [
|
||||||
'pycryptodome==3.8.2',
|
'pycryptodome==3.8.2',
|
||||||
|
|||||||
Executable
BIN
Binary file not shown.
Reference in new issue
Block a user