Last active
January 3, 2016 01:59
-
-
Save yoxyue/8393064 to your computer and use it in GitHub Desktop.
This file contains 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
#coding:utf-8 | |
import os | |
from fpdf import FPDF #使用fpdf库 | |
def makepdf(i,p): | |
pdf= FPDF('P','mm',[368,266]) #设置页面大小 | |
pdf.add_page() | |
pdf.image(p+"/"+u'01台历.jpg',0,0,184,133) #x,y,w,h | |
pdf.image(p+"/"+u'03台历.jpg',184,0,184,133) | |
pdf.image(p+"/"+u'05台历.jpg',0,133,184,133) | |
pdf.image(p+"/"+u'07台历.jpg',184,133,184,133) | |
pdf.add_page() | |
pdf.image(p+"/"+u'04台历.jpg',0,0,184,133) | |
pdf.image(p+"/"+u'02台历.jpg',184,0,184,133) | |
pdf.image(p+"/"+u'08台历.jpg',0,133,184,133) | |
pdf.image(p+"/"+u'06台历.jpg',184,133,184,133) | |
pdf.add_page() | |
pdf.image(p+"/"+u'09台历.jpg',0,0,184,133) | |
pdf.image(p+"/"+u'11台历.jpg',184,0,184,133) | |
pdf.image(p+"/"+u'13台历.jpg',0,133,184,133) | |
pdf.image(u'b.jpg',184,133,184,133) | |
pdf.add_page() | |
pdf.image(p+"/"+u'12台历.jpg',0,0,184,133) | |
pdf.image(p+"/"+u'10台历.jpg',184,0,184,133) | |
pdf.image(u'b.jpg',0,133,184,133) | |
pdf.image(p+"/"+u'14台历.jpg',184,133,184,133) | |
pdf.output(i+'.pdf','F') | |
print i + "----->ok" | |
a=os.path.split(os.getcwdu()) | |
b=os.listdir(os.getcwdu()) | |
for i in b: | |
if os.path.isdir(i)==True : | |
p=os.getcwdu()+"/"+i | |
print p | |
makepdf(i,p) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment