mirror of
https://github.com/subutux/rmapy.git
synced 2025-12-08 14:43:24 +00:00
@@ -113,6 +113,14 @@ class ZipDocument(object):
|
|||||||
rm: A list of :class:rmapy.document.RmPage in this zip.
|
rm: A list of :class:rmapy.document.RmPage in this zip.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
def __init__(self, _id=None, doc=None, file=None):
|
||||||
|
"""Create a new instance of a ZipDocument
|
||||||
|
|
||||||
|
Args:
|
||||||
|
_id: Can be left empty to generate one
|
||||||
|
doc: a raw pdf, epub or rm (.lines) file.
|
||||||
|
file: a zipfile to convert from
|
||||||
|
"""
|
||||||
# {"extraMetadata": {},
|
# {"extraMetadata": {},
|
||||||
# "fileType": "pdf",
|
# "fileType": "pdf",
|
||||||
# "pageCount": 0,
|
# "pageCount": 0,
|
||||||
@@ -121,7 +129,7 @@ class ZipDocument(object):
|
|||||||
# "margins": 180,
|
# "margins": 180,
|
||||||
# "textScale": 1,
|
# "textScale": 1,
|
||||||
# "transform": {}}
|
# "transform": {}}
|
||||||
content = {
|
self.content = {
|
||||||
"extraMetadata": {
|
"extraMetadata": {
|
||||||
# "LastBrushColor": "Black",
|
# "LastBrushColor": "Black",
|
||||||
# "LastBrushThicknessScale": "2",
|
# "LastBrushThicknessScale": "2",
|
||||||
@@ -159,7 +167,7 @@ class ZipDocument(object):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
metadata = {
|
self.metadata = {
|
||||||
"deleted": False,
|
"deleted": False,
|
||||||
"lastModified": "1568368808000",
|
"lastModified": "1568368808000",
|
||||||
"metadatamodified": False,
|
"metadatamodified": False,
|
||||||
@@ -172,22 +180,14 @@ class ZipDocument(object):
|
|||||||
"VissibleName": "New Document"
|
"VissibleName": "New Document"
|
||||||
}
|
}
|
||||||
|
|
||||||
pagedata = "b''"
|
self.pagedata = "b''"
|
||||||
|
|
||||||
zipfile = BytesIO()
|
self.zipfile = BytesIO()
|
||||||
pdf = None
|
self.pdf = None
|
||||||
epub = None
|
self.epub = None
|
||||||
rm: List[RmPage] = []
|
self.rm: List[RmPage] = []
|
||||||
ID = None
|
self.ID = None
|
||||||
|
|
||||||
def __init__(self, _id=None, doc=None, file=None):
|
|
||||||
"""Create a new instance of a ZipDocument
|
|
||||||
|
|
||||||
Args:
|
|
||||||
_id: Can be left empty to generate one
|
|
||||||
doc: a raw pdf, epub or rm (.lines) file.
|
|
||||||
file: a zipfile to convert from
|
|
||||||
"""
|
|
||||||
if not _id:
|
if not _id:
|
||||||
_id = str(uuid4())
|
_id = str(uuid4())
|
||||||
self.ID = _id
|
self.ID = _id
|
||||||
|
|||||||
Reference in New Issue
Block a user