Top Tweets for #withwindow
Gençler böyle şeyler için chatgpt yardımıyla basitçe kodlamayı öğrenin. Artık böyle basit şeyleri yapmanız çok kolay, burada sormanıza bile gerek yok.
Python yükle bilgisayarına. Pythonun comtypes kütüphanesini de yükle. Sonra aşağıdaki kodun sonundaki input ve output dosyalarının yerini kendine göre belirle ve çalıştır. Yapamadığın yerleri chatgptye sorabilirsin.
import os
from comtypes.client import CreateObject
from comtypes import CoInitialize, CoUninitialize
def convert_ppt_to_pdf(input_folder, output_folder):
"""
Converts all .ppt and .pptx files in a folder to PDF and saves them in the output folder.
"""
# Initialize COM environment
CoInitialize()
try:
# Create PowerPoint application object
powerpoint = CreateObject("PowerPoint.Application")
powerpoint.Visible = 1 # Set to 1 to show PowerPoint, 0 to keep it hidden
# Ensure output folder exists
if not os.path.exists(output_folder):
os.makedirs(output_folder)
# Iterate through all files in the input folder
for file_name in os.listdir(input_folder):
if file_name.endswith(".ppt") or file_name.endswith(".pptx"):
input_path = os.path.join(input_folder, file_name)
output_path = os.path.join(output_folder, f"{os.path.splitext(file_name)[0]}.pdf")
print(f"Converting: {file_name} -> {output_path}")
try:
# Open the presentation
presentation = https://t.co/xrKW2pA4OQ(input_path, WithWindow=False)
# Save as PDF
presentation.SaveAs(output_path, FileFormat=32) # 32 is the constant for PDF format
# Close the presentation
presentation.Close()
except Exception as e:
print(f"Failed to convert {file_name}: {e}")
# Quit PowerPoint application
powerpoint.Quit()
finally:
# Uninitialize COM environment
CoUninitialize()
print("Conversion process completed.")
# Usage
input_folder = r"your\path\to\input_folder" # Replace with the path to your folder with PPT files
output_folder = r"your\path\to\output_folder" # Replace with the path to save PDFs
convert_ppt_to_pdf(input_folder, output_folder)
Last Seen Hashtags on Sotwe
Most Popular Users

Elon Musk 
@elonmusk
239.6M followers

Barack Obama 
@barackobama
118.5M followers

Cristiano Ronaldo 
@cristiano
114.3M followers

Donald J. Trump 
@realdonaldtrump
111.7M followers

Narendra Modi 
@narendramodi
106.9M followers

Rihanna 
@rihanna
98.6M followers

NASA 
@nasa
92.1M followers

Justin Bieber 
@justinbieber
91.7M followers

KATY PERRY 
@katyperry
89.9M followers

Taylor Swift 
@taylorswift13
83.9M followers

Lady Gaga 
@ladygaga
75.4M followers

Virat Kohli 
@imvkohli
73.3M followers

Kim Kardashian 
@kimkardashian
70.8M followers

YouTube 
@youtube
68.6M followers

Neymar Jr 
@neymarjr
66.3M followers

Bill Gates 
@billgates
65.1M followers

Selena Gomez 
@selenagomez
63M followers

The Ellen Show
@theellenshow
62.1M followers

CNN 
@cnn
61.7M followers

X 
@x
60.6M followers
