
32位64位无插件无广告
- 文件大小:10.6 MB
- 界面语言:中文
- 发布日期:2023-04-07
- 系统平台:Win7/WinXP/Win8/Win10
- 软件标签:打印软件
广告位500x320
公司办公人员如果经常需要对文本文档开展打印操作,可以试试我产生的这款打印出excel强制性网页页面纵向.exe软件,这是一个很实用的打印出辅助软件,可以帮助用户将各种不同类型和格式的文件生成为纵向的效果,从而让文件完成纵向打印出,满足客户的打印出要求,仅需一键就可以转换。
软件特点
主要为快速的将文件夹里的PPT、EXCEL、WORD生成对应的PDF。
PS:印象中如不能转换仿佛必须组装有office,制成品是写定了为纵向还可以改成横着或是不设置。
操作方法
开启Excel,//点一下左上方的报表标示,点一下打印出,然后选择打印预览,//在打印预览里有个对网页页面纵横的设置,点一下横着,//调节报表的大小,点一下缩放比例,放缩调整到大小合适的比例,//下面挑选页面布局,点一下页面设置,垂直居中方法点一下水平和垂直,设定结束后全部报表就可垂直居中了,然后就可以打印图片了。
编码表明
"""
程序流程功能:将总体目标文件夹内每一个 ppt、excel、word 均生成一份对应的 PDF 文件
创作者:qzw,给予内部使用
总体目标文件夹:默认设置因此程序流程现阶段所在的文件夹;
若键入途径,乃为该文件夹(只转换该层,不转换子文件夹下具体内容)
生成的pdf名字:初始名字 .pdf
"""
import os, win32com.client, gc
Word
def word2Pdf(filePath, words)
要是没有文件则提醒后直接撤出
if(len(words)lt;1)
print ("无 Word 文件")
return
逐渐转换
print ("逐渐 Word -gt; PDF 转换")
try
print ("开启 Word 进程...")
word = win32com.client.Dispatch("Word.Application")
word.Visible = 0
word.DisplayAlerts = False
doc = None
for i in range(len(words))
print(i)
fileName = words[i]文件名字
fromFile = os.path.join(filePath, fileName)文件详细地址
toFileName = changeSufix2Pdf(fileName)生成的文件名字
toFile = toFileJoin(filePath,toFileName)生成的文件详细地址
print ("转换:" fileName "文件中...")
某文件出差错不受影响别的文件打印出
try
doc = word.Documents.Open(fromFile)
doc.SaveAs(toFile,17)生成的所有 PDF 都会在 PDF 文件夹中
print ("转换到:" toFileName "进行")
except Exception as e
print(e)
关掉 Word 进程
print ("全部 Word 文件已打印结束")
print ("完毕 Word 进程...")
doc.Close()
doc = None
word.Quit()
word = None
except Exception as e
print(e)
finally
gc.collect()
Excel
def excel2Pdf(filePath, excels)
要是没有文件则提醒后直接撤出
if(len(excels)lt;1)
print ("无 Excel 文件")
return
逐渐转换
print ("逐渐 Excel -gt; PDF 转换")
try
print ("开启 Excel 进程中...")
excel = win32com.client.Dispatch("Excel.Application")
excel.Visible = 0
excel.DisplayAlerts = False
wb = None
ws = None
for i in range(len(excels))
print(i)
fileName = excels[i]文件名字
fromFile = os.path.join(filePath, fileName)文件详细地址
print ("转换:" fileName "文件中...")
某文件出差错不受影响别的文件打印出
try
wb = excel.Workbooks.Open(fromFile)
for j in range(wb.Worksheets.Count):工作簿总数,一个工作表可能有好几张工作簿
toFileName = addWorksheetsOrder(fileName, j 1)生成的文件名字
toFile = toFileJoin(filePath,toFileName)生成的文件详细地址
ws = wb.Worksheets(j 1)若是为[0]则装包之后提醒越境
ws.PageSetup.Orientation=2设置页面方位,纵向=1,横着=2
ws.ExportAsFixedFormat(0,toFile)每一张都要打印出
print ("转换至:" toFileName "文件进行")
except Exception as e
print(e)
关掉 Excel 进程
print ("全部 Excel 文件已打印结束")
print ("完毕 Excel 进程中...")
ws = None
wb.Close()
wb = None
excel.Quit()
excel = None
except Exception as e
print(e)
finally
gc.collect()
PPT
def ppt2Pdf(filePath, ppts)
要是没有文件则提醒后直接撤出
if(len(ppts)lt;1)
print ("无 PPT 文件")
return
逐渐转换
print ("逐渐 PPT -gt; PDF 转换")
try
print ("开启 PowerPoint 进程中...")
= win32com.client.Dispatch("PowerPoint.Application")
ppt = None
某文件出差错不受影响别的文件打印出
for i in range(len(ppts))
print(i)
fileName = ppts[i]文件名字
fromFile = os.path.join(filePath, fileName)文件详细地址
toFileName = changeSufix2Pdf(fileName)生成的文件名字
toFile = toFileJoin(filePath,toFileName)生成的文件详细地址
print ("转换:" fileName "文件中...")
try
ppt = powerpoint.Presentations.Open(fromFile,WithWindow=False)
if ppt.Slides.Countgt;0
ppt.SaveAs(toFile, 32)假如为空往往会跳出来弹出框(临时找不到清除方法)
print ("转换至:" toFileName "文件进行")
else
print("(不正确,出现意外:此文件为空,绕过此文件)")
except Exception as e
print(e)
关掉 PPT 进程
print ("全部 PPT 文件已打印结束")
print ("完毕 PowerPoint 进程中...")
ppt.Close()
ppt = None
powerpoint.Quit()
powerpoint = None
except Exception as e
print(e)
finally
gc.collect()
改动文件后缀名
def changeSufix2Pdf(file)
return file[:file.rfind(&39;.&39;)] ".pdf"
加上工作表编号
def addWorksheetsOrder(file, i)
return file[:file.rfind(&39;.&39;)] "_工作簿" str(i) ".pdf"
转换详细地址
def toFileJoin(filePath,file)
return os.path.join(filePath,&39;pdf&39;,file[:file.rfind(&39;.&39;)] ".pdf")
逐渐程序流程
print ("====================程序流程逐渐====================")
print ("程序流程功能将目标路径下内每一个 ppt、excel、word 均生成一份对应的 PDF 文件,存有新生成的 pdf 文件夹中(需早已安装office,不包含子文件夹)")
print ("留意:若某 PPT 和 Excel 文件为空,往往会出差错绕过此文件。若转换 PPT 时间过长,请查看是否有出错对话框等候确定,暂且不能彻底消除 PPT 的对话框难题。在关掉进程环节中,时长可能很长,十秒上下,请耐心等待。")
filePath = input ("键入目标路径:(若是为当前路径:" os.getcwd() ",请立即回车键)")
目标路径,若没有键入途径乃为当前路径
if(filePath=="")
filePath = os.getcwd()
将总体目标文件夹全部文件分类,转换时只打开一个进程
words = []
ppts = []
excels = []
for fn in os.listdir(filePath)
if fn.endswith((&39;.doc&39;, &39;docx&39;))
words.append(fn)
if fn.endswith((&39;.ppt&39;, &39;pptx&39;))
ppts.append(fn)
if fn.endswith((&39;.xls&39;, &39;xlsx&39;))
excels.append(fn)
调用方法
print ("====================逐渐转换====================")
新创建 pdf 文件夹,全部生成的 PDF 文件都放在里面
folder = filePath&39;\pdf\&39
if not os.path.exists(folder)
os.makedirs(folder)
word2Pdf(filePath,words)
excel2Pdf(filePath,excels)
ppt2Pdf(filePath,ppts)
print ("====================转换完毕====================")
print ("====================程序结束====================")
os.system("pause")
软件测评
手机软件能够对文本文档开展强制的页面转换实际操作,适用Excel、Word、PPT、PDF等几种格式的文件,让用户能够横向打印文件也可以纵向打印出文件,提高工作效率。
软件特点
主要为快速的将文件夹里的PPT、EXCEL、WORD生成对应的PDF。
PS:印象中如不能转换仿佛必须组装有office,制成品是写定了为纵向还可以改成横着或是不设置。
操作方法
开启Excel,//点一下左上方的报表标示,点一下打印出,然后选择打印预览,//在打印预览里有个对网页页面纵横的设置,点一下横着,//调节报表的大小,点一下缩放比例,放缩调整到大小合适的比例,//下面挑选页面布局,点一下页面设置,垂直居中方法点一下水平和垂直,设定结束后全部报表就可垂直居中了,然后就可以打印图片了。
编码表明
"""
程序流程功能:将总体目标文件夹内每一个 ppt、excel、word 均生成一份对应的 PDF 文件
创作者:qzw,给予内部使用
总体目标文件夹:默认设置因此程序流程现阶段所在的文件夹;
若键入途径,乃为该文件夹(只转换该层,不转换子文件夹下具体内容)
生成的pdf名字:初始名字 .pdf
"""
import os, win32com.client, gc
Word
def word2Pdf(filePath, words)
要是没有文件则提醒后直接撤出
if(len(words)lt;1)
print ("无 Word 文件")
return
逐渐转换
print ("逐渐 Word -gt; PDF 转换")
try
print ("开启 Word 进程...")
word = win32com.client.Dispatch("Word.Application")
word.Visible = 0
word.DisplayAlerts = False
doc = None
for i in range(len(words))
print(i)
fileName = words[i]文件名字
fromFile = os.path.join(filePath, fileName)文件详细地址
toFileName = changeSufix2Pdf(fileName)生成的文件名字
toFile = toFileJoin(filePath,toFileName)生成的文件详细地址
print ("转换:" fileName "文件中...")
某文件出差错不受影响别的文件打印出
try
doc = word.Documents.Open(fromFile)
doc.SaveAs(toFile,17)生成的所有 PDF 都会在 PDF 文件夹中
print ("转换到:" toFileName "进行")
except Exception as e
print(e)
关掉 Word 进程
print ("全部 Word 文件已打印结束")
print ("完毕 Word 进程...")
doc.Close()
doc = None
word.Quit()
word = None
except Exception as e
print(e)
finally
gc.collect()
Excel
def excel2Pdf(filePath, excels)
要是没有文件则提醒后直接撤出
if(len(excels)lt;1)
print ("无 Excel 文件")
return
逐渐转换
print ("逐渐 Excel -gt; PDF 转换")
try
print ("开启 Excel 进程中...")
excel = win32com.client.Dispatch("Excel.Application")
excel.Visible = 0
excel.DisplayAlerts = False
wb = None
ws = None
for i in range(len(excels))
print(i)
fileName = excels[i]文件名字
fromFile = os.path.join(filePath, fileName)文件详细地址
print ("转换:" fileName "文件中...")
某文件出差错不受影响别的文件打印出
try
wb = excel.Workbooks.Open(fromFile)
for j in range(wb.Worksheets.Count):工作簿总数,一个工作表可能有好几张工作簿
toFileName = addWorksheetsOrder(fileName, j 1)生成的文件名字
toFile = toFileJoin(filePath,toFileName)生成的文件详细地址
ws = wb.Worksheets(j 1)若是为[0]则装包之后提醒越境
ws.PageSetup.Orientation=2设置页面方位,纵向=1,横着=2
ws.ExportAsFixedFormat(0,toFile)每一张都要打印出
print ("转换至:" toFileName "文件进行")
except Exception as e
print(e)
关掉 Excel 进程
print ("全部 Excel 文件已打印结束")
print ("完毕 Excel 进程中...")
ws = None
wb.Close()
wb = None
excel.Quit()
excel = None
except Exception as e
print(e)
finally
gc.collect()
PPT
def ppt2Pdf(filePath, ppts)
要是没有文件则提醒后直接撤出
if(len(ppts)lt;1)
print ("无 PPT 文件")
return
逐渐转换
print ("逐渐 PPT -gt; PDF 转换")
try
print ("开启 PowerPoint 进程中...")
= win32com.client.Dispatch("PowerPoint.Application")
ppt = None
某文件出差错不受影响别的文件打印出
for i in range(len(ppts))
print(i)
fileName = ppts[i]文件名字
fromFile = os.path.join(filePath, fileName)文件详细地址
toFileName = changeSufix2Pdf(fileName)生成的文件名字
toFile = toFileJoin(filePath,toFileName)生成的文件详细地址
print ("转换:" fileName "文件中...")
try
ppt = powerpoint.Presentations.Open(fromFile,WithWindow=False)
if ppt.Slides.Countgt;0
ppt.SaveAs(toFile, 32)假如为空往往会跳出来弹出框(临时找不到清除方法)
print ("转换至:" toFileName "文件进行")
else
print("(不正确,出现意外:此文件为空,绕过此文件)")
except Exception as e
print(e)
关掉 PPT 进程
print ("全部 PPT 文件已打印结束")
print ("完毕 PowerPoint 进程中...")
ppt.Close()
ppt = None
powerpoint.Quit()
powerpoint = None
except Exception as e
print(e)
finally
gc.collect()
改动文件后缀名
def changeSufix2Pdf(file)
return file[:file.rfind(&39;.&39;)] ".pdf"
加上工作表编号
def addWorksheetsOrder(file, i)
return file[:file.rfind(&39;.&39;)] "_工作簿" str(i) ".pdf"
转换详细地址
def toFileJoin(filePath,file)
return os.path.join(filePath,&39;pdf&39;,file[:file.rfind(&39;.&39;)] ".pdf")
逐渐程序流程
print ("====================程序流程逐渐====================")
print ("程序流程功能将目标路径下内每一个 ppt、excel、word 均生成一份对应的 PDF 文件,存有新生成的 pdf 文件夹中(需早已安装office,不包含子文件夹)")
print ("留意:若某 PPT 和 Excel 文件为空,往往会出差错绕过此文件。若转换 PPT 时间过长,请查看是否有出错对话框等候确定,暂且不能彻底消除 PPT 的对话框难题。在关掉进程环节中,时长可能很长,十秒上下,请耐心等待。")
filePath = input ("键入目标路径:(若是为当前路径:" os.getcwd() ",请立即回车键)")
目标路径,若没有键入途径乃为当前路径
if(filePath=="")
filePath = os.getcwd()
将总体目标文件夹全部文件分类,转换时只打开一个进程
words = []
ppts = []
excels = []
for fn in os.listdir(filePath)
if fn.endswith((&39;.doc&39;, &39;docx&39;))
words.append(fn)
if fn.endswith((&39;.ppt&39;, &39;pptx&39;))
ppts.append(fn)
if fn.endswith((&39;.xls&39;, &39;xlsx&39;))
excels.append(fn)
调用方法
print ("====================逐渐转换====================")
新创建 pdf 文件夹,全部生成的 PDF 文件都放在里面
folder = filePath&39;\pdf\&39
if not os.path.exists(folder)
os.makedirs(folder)
word2Pdf(filePath,words)
excel2Pdf(filePath,excels)
ppt2Pdf(filePath,ppts)
print ("====================转换完毕====================")
print ("====================程序结束====================")
os.system("pause")
软件测评
手机软件能够对文本文档开展强制的页面转换实际操作,适用Excel、Word、PPT、PDF等几种格式的文件,让用户能够横向打印文件也可以纵向打印出文件,提高工作效率。