diff --git a/doc-src/api.md b/doc-src/api.md index f7a4dd4..a097fa0 100644 --- a/doc-src/api.md +++ b/doc-src/api.md @@ -58,7 +58,8 @@ All layout items extend the `LTItem` class. There are two kinds of layout items: All of these classes extend the LTContainer class. - LTXObject: a layout item containing other additional layout items -- LTCharBlock: a layout item containing LTChars +- LTCharBlock: a layout item containing LTChars, this corresponds to whenever a `TJ` or `Tj` operators is issued within a text object. +- LTTextBlock: a layout item containing LTCharBlocks, note that this directly corresponds to the `BT` and `ET` operators pair in the pdf standard #### Layout Components All of these classes extend the LTComponent class. diff --git a/docs/api/index.html b/docs/api/index.html index 8f61b37..4f328fc 100644 --- a/docs/api/index.html +++ b/docs/api/index.html @@ -62,14 +62,14 @@
The library is constructed from 4 base modules:
WIP
WIP
-
-Contains high-level classes for conversion of the fundamental pdf structures to other formats. This library includes 4 high-level conversion classes:
-These classes all extend the PDFConverter. To use them simply call the static method parse_file.
+a interpreter of the pdf-standard commands
from pdfmajor.converters import HTMLConverter
+from pdfmajor.interpreter import PageInterpreter
-input_file = open('path/to/input/file.pdf', 'rb')
-output_file = open('path/to/output/file.html', 'wb')
-HTMLConverter.parse_file(
- input_file,
- output_file
-)
-input_file.close()
-output_file.close()
+for page in PDFInterpreter("/path/to/pdf.pdf"):
+ print("page start", page.page_num)
+ for item in page:
+ print(" >", item)
+ print("page end", page.page_num)
-converters.convert_file(input_file, output_file, image_folder_path, codec, maxpages, password, caching, check_extractable, pagenos, out_type)
+interpreter.PDFInterpreter
+This generator-function yields individual pages which contain their respected items.
+Arguments
+
+input_file_path: str
+preload: bool defaults to False
+maxpages: int defaults to 0
+password: str defaults to None
+caching: bool defaults to True
+check_extractable: bool defaults to True
+pagenos: List[int] defaults to None
+debug_level: logging.levels defaults logging.WARNING
+
+Yield Value
+This function returns a generator that yields PDFInterpreter.
+interpreter.PageInterpreter
+This generator-function-class yields individual layout items.
+Layout Items
+All layout items extend the LTItem class. There are two kinds of layout items:
+
+- LTComponent: extends the base
LTItem class, this class will have additional values such as boundary boxes, height and width
+- LTContainer: extends the
LTComponent class, this class is used to contain elements of the pdf that would have child elements. Iterating on this element will output its child elements.
+
+Layout Containers
+All of these classes extend the LTContainer class.
+
+- LTXObject: a layout item containing other additional layout items
+- LTCharBlock: a layout item containing LTChars, this corresponds to whenever a
TJ or Tj operators is issued within a text object.
+- LTTextBlock: a layout item containing LTCharBlocks, note that this directly corresponds to the
BT and ET operators pair in the pdf standard
+
+Layout Components
+All of these classes extend the LTComponent class.
+
+- LTChar: an individual character
+- LTCurves: represents a collection of svg-paths (available under
self.paths)
+- LTImage: a component containing information regarding an image
+
+converters
+Contains high-level functions for conversion of the fundamental pdf structures to other formats. This library includes 4 high-level conversion cases:
+
+- HTML
+- JSON
+- XML
+- Text
+
+These formats are all generated using the PageInterpreter. To use them simply call the static method parse_file.
+Example
+from pdfmajor.converters import convert_file
+
+convert_file(
+ "path/to/input/file.pdf",
+ "path/to/output/file.html",
+ out_type="html"
+)
+
+
+converters.convert_file
A high-level abstraction for the conversion classes.
input_file: TextIOWrapper
@@ -155,46 +200,7 @@ output_file.close()
pagenos: List[int] defaults to None
out_type: str defaults to 'html'
-Example (converters.convert_file)
-from pdfmajor.converters import convert_file
-
-input_file = open('path/to/input/file.pdf', 'rb')
-output_file = open('path/to/output/file.html', 'wb')
-convert_file(
- input_file,
- output_file
-)
-input_file.close()
-output_file.close()
-
-
-converters.PDFConverter
-Extends layouts.PDFLayoutAnalyzer.
-converters.PDFConverter.__init__(rsrcmgr, outfp, imagewriter, codec, pageno)
-
-rsrcmgr: PDFResourceManager
-outfp: TextIOWrapper
-imagewriter: ImageWriter
-codec: str defaults to 'utf-8'
-pageno: int defaults to 1
-
-initialization function for the class
-converters.PDFConverter.parse_file(input_file, output_file, image_folder_path, codec, maxpages, password, caching, check_extractable, pagenos)
-returns the output file TextIOWrapper.
-
-input_file: TextIOWrapper
-output_file: TextIOWrapper
-image_folder_path: str defaults to None
-codec: str defaults to 'utf-8'
-maxpages: int defaults to 0
-password: str defaults to None
-caching: bool defaults to True
-check_extractable: bool defaults to True
-pagenos: List[int] defaults to None
-
imagewriter
-WIP
-layouts
WIP
diff --git a/docs/index.html b/docs/index.html
index 66def72..dcd1842 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -59,6 +59,8 @@
Documentation
+ Basic Example
+
Why Another Fork?
Features
@@ -122,23 +124,34 @@
-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. Additionally, this version intends to be more up to date with recent versions of python and make liberal use of the typing capabilities of python for improved future maintainability.
+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.
Documentation
See documentation here.
+Basic Example
+from pdfmajor.interpreter import PageInterpreter
+
+for page in PDFInterpreter("/path/to/pdf.pdf"):
+ print("page start", page.page_num)
+ for item in page:
+ print(" >", item)
+ print("page end", page.page_num)
+
+
+
Why Another Fork?
-PDFMiner was designed to run in python 2.7>, PDFMiner.six was written to bring cross-version support for python 2 and 3. This versions intends to make use of the latest improvement in the python language while remaining fairly simple to develop with.
+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
-- Written entirely in Python.
+- Functional extraction method based on generators
- Parse, analyze, and convert PDF documents.
- PDF-1.7 specification support. (well, almost)
+- Font-Color extraction
+- Shape fill and stroke color extraction
- CJK languages and vertical writing scripts support.
- Various font types (Type1, TrueType, Type3, and CID) support.
- Basic encryption (RC4) support.
-- Font-Color extraction
-- Shape fill and stroke color extraction
-Note: We took out the layout-analysis process in this version (there is no more LTTextHorizontal or LTTextVertical). While the mathematics behind the grouping process was sound, the coupling of the layout-analysis process with the parsing and interpretation process produced unfriendly-code. This feature could be brought back by extending the pdfmajor.layouts.PDFLayoutAnalyzer class, but at the current time is not supported.
+Note: We took out the layout-analysis process in this version (there is no more LTTextHorizontal or LTTextVertical). While the mathematics behind the grouping process was sound, the coupling of the layout-analysis process with the parsing and interpretation process produced unfriendly-code. This feature could be brought back by running your own implementation of it on the pdfmajor.interpreter.PageInterpreter class, but at the current time is not supported.
How to Install
Source
@@ -227,5 +240,5 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/docs/search/search_index.json b/docs/search/search_index.json
index 882a4e9..503d02d 100644
--- a/docs/search/search_index.json
+++ b/docs/search/search_index.json
@@ -1 +1 @@
-{"config":{"lang":["en"],"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"PDFMajor Latest Release 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. Additionally, this version intends to be more up to date with recent versions of python and make liberal use of the typing capabilities of python for improved future maintainability. Documentation See documentation here . Why Another Fork? PDFMiner was designed to run in python 2.7>, PDFMiner.six was written to bring cross-version support for python 2 and 3. This versions intends to make use of the latest improvement in the python language while remaining fairly simple to develop with. Features Written entirely in Python. Parse, analyze, and convert PDF documents. PDF-1.7 specification support. (well, almost) CJK languages and vertical writing scripts support. Various font types (Type1, TrueType, Type3, and CID) support. Basic encryption (RC4) support. Font-Color extraction Shape fill and stroke color extraction Note : We took out the layout-analysis process in this version (there is no more LTTextHorizontal or LTTextVertical). While the mathematics behind the grouping process was sound, the coupling of the layout-analysis process with the parsing and interpretation process produced unfriendly-code. This feature could be brought back by extending the pdfmajor.layouts.PDFLayoutAnalyzer class, but at the current time is not supported. How to Install Source Install Python 3.6.4 or newer. clone this repo git clone https://github.com/asosnovsky/pdfmajor * install repo python setup.py install Pypi Install Python 3.6.4 or newer. install repo pip install pdfmajor Terms and Conditions (This is so-called MIT/X License) Copyright (c) 2018-2019 Ariel Sosnovsky Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","title":"Home"},{"location":"#pdfmajor","text":"Latest Release 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. Additionally, this version intends to be more up to date with recent versions of python and make liberal use of the typing capabilities of python for improved future maintainability.","title":"PDFMajor"},{"location":"#documentation","text":"See documentation here .","title":"Documentation"},{"location":"#why-another-fork","text":"PDFMiner was designed to run in python 2.7>, PDFMiner.six was written to bring cross-version support for python 2 and 3. This versions intends to make use of the latest improvement in the python language while remaining fairly simple to develop with.","title":"Why Another Fork?"},{"location":"#features","text":"Written entirely in Python. Parse, analyze, and convert PDF documents. PDF-1.7 specification support. (well, almost) CJK languages and vertical writing scripts support. Various font types (Type1, TrueType, Type3, and CID) support. Basic encryption (RC4) support. Font-Color extraction Shape fill and stroke color extraction Note : We took out the layout-analysis process in this version (there is no more LTTextHorizontal or LTTextVertical). While the mathematics behind the grouping process was sound, the coupling of the layout-analysis process with the parsing and interpretation process produced unfriendly-code. This feature could be brought back by extending the pdfmajor.layouts.PDFLayoutAnalyzer class, but at the current time is not supported.","title":"Features"},{"location":"#how-to-install","text":"","title":"How to Install"},{"location":"#source","text":"Install Python 3.6.4 or newer. clone this repo git clone https://github.com/asosnovsky/pdfmajor * install repo python setup.py install","title":"Source"},{"location":"#pypi","text":"Install Python 3.6.4 or newer. install repo pip install pdfmajor","title":"Pypi"},{"location":"#terms-and-conditions","text":"(This is so-called MIT/X License) Copyright (c) 2018-2019 Ariel Sosnovsky Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","title":"Terms and Conditions"},{"location":"api/","text":"API The library is constructed from 4 base modules: interpreter : contains low-level classes for extracting fundamental data-structures from the documents converters : contains high-level classes for conversion of the fundamental pdf structures to other formats imagewriter : contains a simple implementation for converting PDF Image Streams to png/bmp/img formats layouts : contains an abstraction layer for the data-structures found in the pdf interpreter WIP converters Contains high-level classes for conversion of the fundamental pdf structures to other formats. This library includes 4 high-level conversion classes: HTMLConverter JSONConverter XMLConverter TextConverter These classes all extend the PDFConverter . To use them simply call the static method parse_file . Example from pdfmajor.converters import HTMLConverter input_file = open('path/to/input/file.pdf', 'rb') output_file = open('path/to/output/file.html', 'wb') HTMLConverter.parse_file( input_file, output_file ) input_file.close() output_file.close() converters.convert_file(input_file, output_file, image_folder_path, codec, maxpages, password, caching, check_extractable, pagenos, out_type) A high-level abstraction for the conversion classes. input_file : TextIOWrapper output_file : TextIOWrapper image_folder_path : str defaults to None codec : str defaults to 'utf-8' maxpages : int defaults to 0 password : str defaults to None caching : bool defaults to True check_extractable : bool defaults to True pagenos : List[int] defaults to None out_type : str defaults to 'html' Example (converters.convert_file) from pdfmajor.converters import convert_file input_file = open('path/to/input/file.pdf', 'rb') output_file = open('path/to/output/file.html', 'wb') convert_file( input_file, output_file ) input_file.close() output_file.close() converters.PDFConverter Extends layouts.PDFLayoutAnalyzer . converters.PDFConverter.__init__(rsrcmgr, outfp, imagewriter, codec, pageno) rsrcmgr : PDFResourceManager outfp : TextIOWrapper imagewriter : ImageWriter codec : str defaults to 'utf-8' pageno : int defaults to 1 initialization function for the class converters.PDFConverter.parse_file(input_file, output_file, image_folder_path, codec, maxpages, password, caching, check_extractable, pagenos) returns the output file TextIOWrapper . input_file : TextIOWrapper output_file : TextIOWrapper image_folder_path : str defaults to None codec : str defaults to 'utf-8' maxpages : int defaults to 0 password : str defaults to None caching : bool defaults to True check_extractable : bool defaults to True pagenos : List[int] defaults to None imagewriter WIP layouts WIP","title":"API"},{"location":"api/#api","text":"The library is constructed from 4 base modules: interpreter : contains low-level classes for extracting fundamental data-structures from the documents converters : contains high-level classes for conversion of the fundamental pdf structures to other formats imagewriter : contains a simple implementation for converting PDF Image Streams to png/bmp/img formats layouts : contains an abstraction layer for the data-structures found in the pdf","title":"API"},{"location":"api/#interpreter","text":"WIP","title":"interpreter"},{"location":"api/#converters","text":"Contains high-level classes for conversion of the fundamental pdf structures to other formats. This library includes 4 high-level conversion classes: HTMLConverter JSONConverter XMLConverter TextConverter These classes all extend the PDFConverter . To use them simply call the static method parse_file .","title":"converters"},{"location":"api/#example","text":"from pdfmajor.converters import HTMLConverter input_file = open('path/to/input/file.pdf', 'rb') output_file = open('path/to/output/file.html', 'wb') HTMLConverter.parse_file( input_file, output_file ) input_file.close() output_file.close()","title":"Example"},{"location":"api/#convertersconvert_fileinput_file-output_file-image_folder_path-codec-maxpages-password-caching-check_extractable-pagenos-out_type","text":"A high-level abstraction for the conversion classes. input_file : TextIOWrapper output_file : TextIOWrapper image_folder_path : str defaults to None codec : str defaults to 'utf-8' maxpages : int defaults to 0 password : str defaults to None caching : bool defaults to True check_extractable : bool defaults to True pagenos : List[int] defaults to None out_type : str defaults to 'html'","title":"converters.convert_file(input_file, output_file, image_folder_path, codec, maxpages, password, caching, check_extractable, pagenos, out_type)"},{"location":"api/#example-convertersconvert_file","text":"from pdfmajor.converters import convert_file input_file = open('path/to/input/file.pdf', 'rb') output_file = open('path/to/output/file.html', 'wb') convert_file( input_file, output_file ) input_file.close() output_file.close()","title":"Example (converters.convert_file)"},{"location":"api/#converterspdfconverter","text":"Extends layouts.PDFLayoutAnalyzer .","title":"converters.PDFConverter"},{"location":"api/#converterspdfconverter9595init9595rsrcmgr-outfp-imagewriter-codec-pageno","text":"rsrcmgr : PDFResourceManager outfp : TextIOWrapper imagewriter : ImageWriter codec : str defaults to 'utf-8' pageno : int defaults to 1 initialization function for the class","title":"converters.PDFConverter.__init__(rsrcmgr, outfp, imagewriter, codec, pageno)"},{"location":"api/#converterspdfconverterparse_fileinput_file-output_file-image_folder_path-codec-maxpages-password-caching-check_extractable-pagenos","text":"returns the output file TextIOWrapper . input_file : TextIOWrapper output_file : TextIOWrapper image_folder_path : str defaults to None codec : str defaults to 'utf-8' maxpages : int defaults to 0 password : str defaults to None caching : bool defaults to True check_extractable : bool defaults to True pagenos : List[int] defaults to None","title":"converters.PDFConverter.parse_file(input_file, output_file, image_folder_path, codec, maxpages, password, caching, check_extractable, pagenos)"},{"location":"api/#imagewriter","text":"WIP","title":"imagewriter"},{"location":"api/#layouts","text":"WIP","title":"layouts"}]}
\ No newline at end of file
+{"config":{"lang":["en"],"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"PDFMajor Latest Release 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. Documentation See documentation here . Basic Example from pdfmajor.interpreter import PageInterpreter for page in PDFInterpreter(\"/path/to/pdf.pdf\"): print(\"page start\", page.page_num) for item in page: print(\" >\", item) print(\"page end\", page.page_num) Why Another Fork? 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 Functional extraction method based on generators Parse, analyze, and convert PDF documents. PDF-1.7 specification support. (well, almost) Font-Color extraction Shape fill and stroke color extraction CJK languages and vertical writing scripts support. Various font types (Type1, TrueType, Type3, and CID) support. Basic encryption (RC4) support. Note : We took out the layout-analysis process in this version (there is no more LTTextHorizontal or LTTextVertical). While the mathematics behind the grouping process was sound, the coupling of the layout-analysis process with the parsing and interpretation process produced unfriendly-code. This feature could be brought back by running your own implementation of it on the pdfmajor.interpreter.PageInterpreter class, but at the current time is not supported. How to Install Source Install Python 3.6.4 or newer. clone this repo git clone https://github.com/asosnovsky/pdfmajor * install repo python setup.py install Pypi Install Python 3.6.4 or newer. install repo pip install pdfmajor Terms and Conditions (This is so-called MIT/X License) Copyright (c) 2018-2019 Ariel Sosnovsky Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","title":"Home"},{"location":"#pdfmajor","text":"Latest Release 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.","title":"PDFMajor"},{"location":"#documentation","text":"See documentation here .","title":"Documentation"},{"location":"#basic-example","text":"from pdfmajor.interpreter import PageInterpreter for page in PDFInterpreter(\"/path/to/pdf.pdf\"): print(\"page start\", page.page_num) for item in page: print(\" >\", item) print(\"page end\", page.page_num)","title":"Basic Example"},{"location":"#why-another-fork","text":"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.","title":"Why Another Fork?"},{"location":"#features","text":"Functional extraction method based on generators Parse, analyze, and convert PDF documents. PDF-1.7 specification support. (well, almost) Font-Color extraction Shape fill and stroke color extraction CJK languages and vertical writing scripts support. Various font types (Type1, TrueType, Type3, and CID) support. Basic encryption (RC4) support. Note : We took out the layout-analysis process in this version (there is no more LTTextHorizontal or LTTextVertical). While the mathematics behind the grouping process was sound, the coupling of the layout-analysis process with the parsing and interpretation process produced unfriendly-code. This feature could be brought back by running your own implementation of it on the pdfmajor.interpreter.PageInterpreter class, but at the current time is not supported.","title":"Features"},{"location":"#how-to-install","text":"","title":"How to Install"},{"location":"#source","text":"Install Python 3.6.4 or newer. clone this repo git clone https://github.com/asosnovsky/pdfmajor * install repo python setup.py install","title":"Source"},{"location":"#pypi","text":"Install Python 3.6.4 or newer. install repo pip install pdfmajor","title":"Pypi"},{"location":"#terms-and-conditions","text":"(This is so-called MIT/X License) Copyright (c) 2018-2019 Ariel Sosnovsky Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","title":"Terms and Conditions"},{"location":"api/","text":"API The library is constructed from 4 base modules: parser : contains low-level classes for extracting fundamental data-structures from the documents interpreter : a interpreter of the pdf-standard commands converters : contains high-level functions for conversion of the fundamental pdf structures to other formats imagewriter : contains a simple implementation for converting PDF Image Streams to png/bmp/img formats parser WIP interpreter a interpreter of the pdf-standard commands Example from pdfmajor.interpreter import PageInterpreter for page in PDFInterpreter(\"/path/to/pdf.pdf\"): print(\"page start\", page.page_num) for item in page: print(\" >\", item) print(\"page end\", page.page_num) interpreter.PDFInterpreter This generator-function yields individual pages which contain their respected items. Arguments input_file_path : str preload : bool defaults to False maxpages : int defaults to 0 password : str defaults to None caching : bool defaults to True check_extractable : bool defaults to True pagenos : List[int] defaults to None debug_level : logging.levels defaults logging.WARNING Yield Value This function returns a generator that yields PDFInterpreter . interpreter.PageInterpreter This generator-function-class yields individual layout items . Layout Items All layout items extend the LTItem class. There are two kinds of layout items: LTComponent: extends the base LTItem class, this class will have additional values such as boundary boxes, height and width LTContainer: extends the LTComponent class, this class is used to contain elements of the pdf that would have child elements. Iterating on this element will output its child elements. Layout Containers All of these classes extend the LTContainer class. LTXObject: a layout item containing other additional layout items LTCharBlock: a layout item containing LTChars, this corresponds to whenever a TJ or Tj operators is issued within a text object. LTTextBlock: a layout item containing LTCharBlocks, note that this directly corresponds to the BT and ET operators pair in the pdf standard Layout Components All of these classes extend the LTComponent class. LTChar: an individual character LTCurves: represents a collection of svg-paths (available under self.paths ) LTImage: a component containing information regarding an image converters Contains high-level functions for conversion of the fundamental pdf structures to other formats. This library includes 4 high-level conversion cases: HTML JSON XML Text These formats are all generated using the PageInterpreter . To use them simply call the static method parse_file . Example from pdfmajor.converters import convert_file convert_file( \"path/to/input/file.pdf\", \"path/to/output/file.html\", out_type=\"html\" ) converters.convert_file A high-level abstraction for the conversion classes. input_file : TextIOWrapper output_file : TextIOWrapper image_folder_path : str defaults to None codec : str defaults to 'utf-8' maxpages : int defaults to 0 password : str defaults to None caching : bool defaults to True check_extractable : bool defaults to True pagenos : List[int] defaults to None out_type : str defaults to 'html' imagewriter WIP","title":"API"},{"location":"api/#api","text":"The library is constructed from 4 base modules: parser : contains low-level classes for extracting fundamental data-structures from the documents interpreter : a interpreter of the pdf-standard commands converters : contains high-level functions for conversion of the fundamental pdf structures to other formats imagewriter : contains a simple implementation for converting PDF Image Streams to png/bmp/img formats","title":"API"},{"location":"api/#parser","text":"WIP","title":"parser"},{"location":"api/#interpreter","text":"a interpreter of the pdf-standard commands","title":"interpreter"},{"location":"api/#example","text":"from pdfmajor.interpreter import PageInterpreter for page in PDFInterpreter(\"/path/to/pdf.pdf\"): print(\"page start\", page.page_num) for item in page: print(\" >\", item) print(\"page end\", page.page_num)","title":"Example"},{"location":"api/#interpreterpdfinterpreter","text":"This generator-function yields individual pages which contain their respected items.","title":"interpreter.PDFInterpreter"},{"location":"api/#arguments","text":"input_file_path : str preload : bool defaults to False maxpages : int defaults to 0 password : str defaults to None caching : bool defaults to True check_extractable : bool defaults to True pagenos : List[int] defaults to None debug_level : logging.levels defaults logging.WARNING","title":"Arguments"},{"location":"api/#yield-value","text":"This function returns a generator that yields PDFInterpreter .","title":"Yield Value"},{"location":"api/#interpreterpageinterpreter","text":"This generator-function-class yields individual layout items .","title":"interpreter.PageInterpreter"},{"location":"api/#layout-items","text":"All layout items extend the LTItem class. There are two kinds of layout items: LTComponent: extends the base LTItem class, this class will have additional values such as boundary boxes, height and width LTContainer: extends the LTComponent class, this class is used to contain elements of the pdf that would have child elements. Iterating on this element will output its child elements.","title":"Layout Items"},{"location":"api/#layout-containers","text":"All of these classes extend the LTContainer class. LTXObject: a layout item containing other additional layout items LTCharBlock: a layout item containing LTChars, this corresponds to whenever a TJ or Tj operators is issued within a text object. LTTextBlock: a layout item containing LTCharBlocks, note that this directly corresponds to the BT and ET operators pair in the pdf standard","title":"Layout Containers"},{"location":"api/#layout-components","text":"All of these classes extend the LTComponent class. LTChar: an individual character LTCurves: represents a collection of svg-paths (available under self.paths ) LTImage: a component containing information regarding an image","title":"Layout Components"},{"location":"api/#converters","text":"Contains high-level functions for conversion of the fundamental pdf structures to other formats. This library includes 4 high-level conversion cases: HTML JSON XML Text These formats are all generated using the PageInterpreter . To use them simply call the static method parse_file .","title":"converters"},{"location":"api/#example_1","text":"from pdfmajor.converters import convert_file convert_file( \"path/to/input/file.pdf\", \"path/to/output/file.html\", out_type=\"html\" )","title":"Example"},{"location":"api/#convertersconvert_file","text":"A high-level abstraction for the conversion classes. input_file : TextIOWrapper output_file : TextIOWrapper image_folder_path : str defaults to None codec : str defaults to 'utf-8' maxpages : int defaults to 0 password : str defaults to None caching : bool defaults to True check_extractable : bool defaults to True pagenos : List[int] defaults to None out_type : str defaults to 'html'","title":"converters.convert_file"},{"location":"api/#imagewriter","text":"WIP","title":"imagewriter"}]}
\ No newline at end of file
diff --git a/docs/sitemap.xml b/docs/sitemap.xml
index 940a8fa..8e5860e 100644
--- a/docs/sitemap.xml
+++ b/docs/sitemap.xml
@@ -2,12 +2,12 @@
None
- 2018-11-04
+ 2018-12-24
daily
None
- 2018-11-04
+ 2018-12-24
daily
\ No newline at end of file
diff --git a/docs/sitemap.xml.gz b/docs/sitemap.xml.gz
index dfdc958..c08811b 100644
Binary files a/docs/sitemap.xml.gz and b/docs/sitemap.xml.gz differ