Skip to content

Commit 12ee998

Browse files
authored
Merge pull request DhanushNehru#244 from mannyguzman/master
Image Text to PDF, print file names, and path location of converted file
2 parents 10e474a + c35f035 commit 12ee998

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Image Text to PDF/script.py

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image
44
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
55
from reportlab.lib.units import inch
6+
import os
67

78
context=[]
89
img="img.jpg"
@@ -29,3 +30,10 @@
2930
context.append(Paragraph(line, styles["Normal"]))
3031

3132
doc.build(context)
33+
34+
pdf_filename = doc.filename
35+
pdf_filepath = os.path.dirname(os.path.abspath(pdf_filename))
36+
37+
print("PDF succesfully created!")
38+
print("-File name: ", os.path.basename(pdf_filename))
39+
print("-PDF Location: ", pdf_filepath + "\\" + pdf_filename)

0 commit comments

Comments
 (0)