You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
394B

  1. import fitz
  2. def ofd_to_pdf(file_path):
  3. doc = fitz.open(file_path)
  4. pdf_bytes = doc.convert_to_pdf()
  5. with open(file_path[:-4] + ".pdf", "wb") as f:
  6. f.write(pdf_bytes)
  7. def pdf_to_ofd(file_path):
  8. doc = fitz.open(file_path)
  9. ofd_bytes = doc.convert_to_ofd()
  10. with open(file_path[:-4] + ".ofd", "wb") as f:
  11. f.write(ofd_bytes)
  12. ofd_to_pdf("发票-01885817.ofd")
上海开阖软件有限公司 沪ICP备12045867号-1