Convert images to pdf using python (image-> pdf) Mirsanov Uralboy Muhammadiyevich


A tool for converting images to PDF



Download 28,36 Kb.
bet3/3
Sana07.07.2022
Hajmi28,36 Kb.
#752652
1   2   3
Bog'liq
CONVERT IMAGES TO PDF USING PYTHON

A tool for converting images to PDF
Based on Python's graphical interface and tkinter package, the engine code for converting images to PDF is:
from PIL import Image
import tkinter as tk
from tkinter import filedialog
from tkinter import messagebox
root = tk.Tk ()
canvas1 = tk.Canvas (root, width = 300, height = 300, bg = 'lightsteelblue2', relief = 'raised')
canvas1.pack ()
label1 = tk.Label (root, text = 'File Conversion Tool', bg = 'lightsteelblue2')
label1.config (font = ('helvetica', 20))
canvas1.create_window (150, 60, window = label1)
def getFile ():
global im1
import_file_path = filedialog.askopenfilename ()
image1 = Image.open (import_file_path)
im1 = image1.convert ('RGB')
browseButton = tk.Button (text = " Select File ", command = getFile, bg = 'green', fg = 'white', font = ('helvetica', 12, 'bold'))
canvas1.create_window (150, 130, window = browseButton)
def convertToPdf ():
global im1
export_file_path = filedialog.asksaveasfilename (defaultextension = '. pdf')
im1.save (export_file_path)
saveAsButton = tk.Button (text = 'Convert to PDF', command = convertToPdf, bg = 'green', fg = 'white', font = ('helvetica', 12, 'bold'))
canvas1.create_window (150, 180, window = saveAsButton)
def exitApplication ():
MsgBox = tk.messagebox.askquestion ('Exit Application', 'Are you sure you want to exit the application', icon = 'warning')
if MsgBox == 'yes':
root.destroy ()
exitButton = tk.Button (root, text = 'Exit Application', command = exitApplication, bg = 'brown', fg = 'white', font = ('helvetica', 12, 'bold'))
canvas1.create_window (150, 230, window = exitButton)
root.mainloop ()


List of used literature
1. Sh.M. Mirziyoyev. "Together we will build a free and prosperous, democratic state of Uzbekistan" - Tashkent: Uzbekistan, 2016. - 56 p.
2. Sh.M. Mirziyoyev. "Critical analysis, strict discipline and personal responsibility - should be a daily rule of every leader" - Tashkent: Uzbekistan, 2017. - 104 p.
3. Sh.M.Mirziyoyev. "Let's build our great future with our brave and noble people." Tashkent: Uzbekistan, 2017. - 488 p.
4. Resolution of Karimov IA dedicated to the 20th anniversary of independence of the Republic of Uzbekistan. People's Word newspaper. April 7, 2011 No. 68.
5. B.J.Boltayev, A.R.Azamatov, A.D.Askarov, M.Q.Sodiqov, G.A.Azamatova, N.Tayloqov. "Fundamentals of Informatics and Computer Engineering". Textbook for 9th grade of secondary schools. -Cholpon: Tashkent, 2020. Page 47
Download 28,36 Kb.

Do'stlaringiz bilan baham:
1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish