mirror of
https://github.com/bringout/euro-office.git
synced 2026-04-24 09:42:06 +02:00
init: Euro-Office Odoo 16.0 modules
Based on onlyoffice_odoo by Ascensio System SIA (ONLYOFFICE, LGPL-3). Rebranded and adapted for Euro-Office by bring.out d.o.o. Modules: - eurooffice_odoo: base integration - eurooffice_odoo_templates: document templates - eurooffice_odoo_oca_dms: OCA DMS integration (replaces Enterprise documents) All references renamed: onlyoffice -> eurooffice, ONLYOFFICE -> Euro-Office. Original copyright notices preserved.
This commit is contained in:
commit
b59a9dc6bb
347 changed files with 16699 additions and 0 deletions
|
|
@ -0,0 +1,39 @@
|
|||
# TODO: add convert docx to pdf
|
||||
|
||||
|
||||
def is_pdf_form(text):
|
||||
if not text:
|
||||
return False
|
||||
|
||||
index_first = text.find(b"%\xcd\xca\xd2\xa9\x0d")
|
||||
if index_first == -1:
|
||||
return False
|
||||
|
||||
p_first = text[index_first + 6 :]
|
||||
|
||||
if not p_first.startswith(b"1 0 obj\x0a<<\x0a"):
|
||||
return False
|
||||
|
||||
p_first = p_first[11:]
|
||||
|
||||
signature = b"Euro-OfficeFORM"
|
||||
index_stream = p_first.find(b"stream\x0d\x0a")
|
||||
index_meta = p_first.find(signature)
|
||||
|
||||
if index_stream == -1 or index_meta == -1 or index_stream < index_meta:
|
||||
return False
|
||||
|
||||
p_meta = p_first[index_meta:]
|
||||
p_meta = p_meta[len(signature) + 3 :]
|
||||
|
||||
index_meta_last = p_meta.find(b" ")
|
||||
if index_meta_last == -1:
|
||||
return False
|
||||
|
||||
p_meta = p_meta[index_meta_last + 1 :]
|
||||
|
||||
index_meta_last = p_meta.find(b" ")
|
||||
if index_meta_last == -1:
|
||||
return False
|
||||
|
||||
return True
|
||||
Loading…
Add table
Add a link
Reference in a new issue