Last active
July 16, 2025 15:05
-
-
Save shivangipokhriyal/709bcaf6a16e2573bf41df3a3163caa7 to your computer and use it in GitHub Desktop.
Python File Structure
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
annotations=[ | |
dict( | |
text="Note: Deviation calculated as (PDS - SilverCnf) / PDS", | |
showarrow=False, | |
xref='paper', yref='paper', | |
x=0, y=-0.2, # Position below chart | |
xanchor='left', | |
font=dict(size=10, color="gray") | |
) | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import mammoth
import pdfkit
def docx_to_pdf(input_docx, output_pdf):
# Convert DOCX to HTML string
with open(input_docx, "rb") as docx_file:
result = mammoth.convert_to_html(docx_file)
html = result.value # The generated HTML
Example usage:
docx_to_pdf("example.docx", "output.pdf")