Skip to content

Commit d8553f5

Browse files
committed
[office] - Script to convert PDF to DOCX
1 parent 38732e5 commit d8553f5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

office/convert_pdf_doc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env python
2+
3+
from pdf2docx import parse
4+
import argparse
5+
6+
parser = argparse.ArgumentParser(description='Convert PDF file to DOCX format')
7+
parser.add_argument('-if', dest='input', metavar='PATH', type=str,
8+
help='Path to input PDF file')
9+
parser.add_argument('-of', dest='output',metavar='PATH', type=str,
10+
help='Path to output DOCX file')
11+
12+
args = parser.parse_args()
13+
14+
pdf_file = args.input
15+
word_file = args.output
16+
parse(pdf_file, word_file, start=0, end=None)
17+

0 commit comments

Comments
 (0)