Created
March 14, 2022 00:41
-
-
Save arangates/b9faf6906ed91323b6cb7604259ed3af to your computer and use it in GitHub Desktop.
[ypdf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %% | |
from docx import Document | |
# %% | |
document = Document('./sample.docx') | |
# %% | |
paragraphs = document.paragraphs | |
# %% | |
for para in paragraphs: | |
if para.alignment is None and para.style.name == 'ECA_Level2_ASML': | |
print(para.text) | |
print('\n') | |
# %% | |
from docx2pdf import convert | |
# %% | |
convert('~/Documents/asml_learning/sample.docx', '~/Documents/asml_learning/output.pdf') | |
# %% | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment