convert-stream 2.2.1__tar.gz → 2.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of convert-stream might be problematic. Click here for more details.
- {convert_stream-2.2.1 → convert_stream-2.2.4}/PKG-INFO +1 -1
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/pdf/pdf_document.py +16 -17
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/stream.py +1 -1
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream.egg-info/PKG-INFO +1 -1
- {convert_stream-2.2.1 → convert_stream-2.2.4}/pyproject.toml +1 -1
- {convert_stream-2.2.1 → convert_stream-2.2.4}/README.md +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/__init__.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/__main__.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/_version.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/enum_libs/enums.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/enum_libs/modules.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/image/__init__.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/image/img_object.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/pdf/__init__.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/pdf/image_to_pdf.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/pdf/pdf_page.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/pdf/pdf_to_image.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/sheets/__init__.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/sheets/load.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/sheets/parse.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/sheets/save.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/table_files.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/text/__init__.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/text/date.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream/text/string.py +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream.egg-info/SOURCES.txt +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream.egg-info/dependency_links.txt +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream.egg-info/requires.txt +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/convert_stream.egg-info/top_level.txt +0 -0
- {convert_stream-2.2.1 → convert_stream-2.2.4}/setup.cfg +0 -0
|
@@ -39,11 +39,11 @@ class ABCDocument(ABC):
|
|
|
39
39
|
pass
|
|
40
40
|
|
|
41
41
|
@abstractmethod
|
|
42
|
-
def add_page(self, page:
|
|
42
|
+
def add_page(self, page: PageDocumentPdf):
|
|
43
43
|
pass
|
|
44
44
|
|
|
45
45
|
@abstractmethod
|
|
46
|
-
def add_pages(self, pages: list[
|
|
46
|
+
def add_pages(self, pages: list[PageDocumentPdf]):
|
|
47
47
|
pass
|
|
48
48
|
|
|
49
49
|
@abstractmethod
|
|
@@ -100,11 +100,16 @@ class ImplementDocumentFitz(ABCDocument):
|
|
|
100
100
|
def get_number_pages(self) -> int:
|
|
101
101
|
return self.mod_doc_pdf.page_count
|
|
102
102
|
|
|
103
|
-
def add_page(self, page:
|
|
103
|
+
def add_page(self, page: PageDocumentPdf):
|
|
104
104
|
# Assume que page.mod_page é fitz.Page
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
# temp_doc = fitz.open()
|
|
106
|
+
self.mod_doc_pdf.insert_pdf(
|
|
107
|
+
page.implement_page_pdf.mod_page.parent,
|
|
108
|
+
from_page=page.implement_page_pdf.mod_page.number,
|
|
109
|
+
to_page=page.implement_page_pdf.mod_page.number
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
def add_pages(self, pages: list[PageDocumentPdf]):
|
|
108
113
|
for page in pages:
|
|
109
114
|
self.add_page(page)
|
|
110
115
|
|
|
@@ -156,7 +161,6 @@ class ImplementDocumentFitz(ABCDocument):
|
|
|
156
161
|
|
|
157
162
|
@classmethod
|
|
158
163
|
def create_from_pages(cls, pages: list[PageDocumentPdf]) -> ImplementDocumentFitz:
|
|
159
|
-
|
|
160
164
|
pdf_document = fitz.Document() # Criar novo documento PDF.
|
|
161
165
|
for page in pages:
|
|
162
166
|
# Verifica se a página é do tipo fitz.Page
|
|
@@ -170,11 +174,6 @@ class ImplementDocumentFitz(ABCDocument):
|
|
|
170
174
|
)
|
|
171
175
|
|
|
172
176
|
bt = BytesIO(pdf_document.write())
|
|
173
|
-
#name = get_hash_from_bytes(bt)
|
|
174
|
-
#bt.seek(0)
|
|
175
|
-
#bt.close()
|
|
176
|
-
#del bt
|
|
177
|
-
#return cls(pdf_document, name)
|
|
178
177
|
return cls.create_from_bytes(bt)
|
|
179
178
|
|
|
180
179
|
|
|
@@ -215,10 +214,10 @@ class ImplementDocumentPyPdf(ABCDocument):
|
|
|
215
214
|
def get_number_pages(self) -> int:
|
|
216
215
|
return len(self.mod_doc_pdf.pages)
|
|
217
216
|
|
|
218
|
-
def add_page(self, page:
|
|
219
|
-
self.mod_doc_pdf.add_page(page)
|
|
217
|
+
def add_page(self, page: PageDocumentPdf):
|
|
218
|
+
self.mod_doc_pdf.add_page(page.implement_page_pdf.mod_page)
|
|
220
219
|
|
|
221
|
-
def add_pages(self, pages: list[
|
|
220
|
+
def add_pages(self, pages: list[PageDocumentPdf]):
|
|
222
221
|
for page in pages:
|
|
223
222
|
self.add_page(page)
|
|
224
223
|
|
|
@@ -327,10 +326,10 @@ class DocumentPdf(object):
|
|
|
327
326
|
def get_number_pages(self) -> int:
|
|
328
327
|
return self.doc_pdf.get_number_pages()
|
|
329
328
|
|
|
330
|
-
def add_page(self, page:
|
|
329
|
+
def add_page(self, page: PageDocumentPdf):
|
|
331
330
|
self.doc_pdf.add_page(page)
|
|
332
331
|
|
|
333
|
-
def add_pages(self, pages: list[
|
|
332
|
+
def add_pages(self, pages: list[PageDocumentPdf]):
|
|
334
333
|
self.doc_pdf.add_pages(pages)
|
|
335
334
|
|
|
336
335
|
def to_file(self, file: File):
|
|
@@ -79,7 +79,7 @@ class PdfStream(object):
|
|
|
79
79
|
self.collection_pages.add_page(page)
|
|
80
80
|
|
|
81
81
|
def add_pages(self, pages: list[PageDocumentPdf]) -> None:
|
|
82
|
-
self.add_pages(pages)
|
|
82
|
+
self.collection_pages.add_pages(pages)
|
|
83
83
|
|
|
84
84
|
def add_file_image(self, f: File) -> None:
|
|
85
85
|
self.collection_images.add_file_image(f)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|