Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 11cd4a3

Browse files
PDF to WORD - Python
Do you know that you can convert PDF file to Word file in Python programming language? This video shows how to convert PDF file to Word file in Python programming language. If you watch the video until the end, you will learn in detail how to convert PDF file to Word file in Python programming language.
1 parent 4d0a0dc commit 11cd4a3

File tree

12 files changed

+73
-0
lines changed

12 files changed

+73
-0
lines changed

‎.idea/.gitignore‎

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/.name‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/inspectionProfiles/Project_Default.xml‎

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/inspectionProfiles/profiles_settings.xml‎

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/misc.xml‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/modules.xml‎

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/pythonProject.iml‎

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/vcs.xml‎

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎PDF to WORD - Python.py‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from pdf2docx import parse
2+
from typing import Tuple
3+
4+
def convert_pdf2docs(input_file :str, output_file : str, pages: Tuple = None):
5+
6+
if pages:
7+
pages = [int(i) for i in list(pages) if i.isnumeric()]
8+
result = parse(pdf_file=input_file,
9+
docx_file= output_file, pages=pages)
10+
11+
summary = {
12+
"File" : input_file, "Pages": str(pages), "Output File": output_file
13+
}
14+
15+
print("## Summary #########################################################")
16+
print("\n".join("{}:{}".format(i, j) for i , j in summary.items()))
17+
print("#####################################################################")
18+
return result
19+
20+
if __name__ == "__main__":
21+
import sys
22+
input_file = "pc.pdf"
23+
output_file = "pcs.docx"
24+
convert_pdf2docs(input_file, output_file)

‎pc.docx‎

39.8 KB
Binary file not shown.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /