当前位置: 首页>>代码示例>>Python>>正文


Python PdfFileWriter._addObject方法代码示例

本文整理汇总了Python中pyPdf.PdfFileWriter._addObject方法的典型用法代码示例。如果您正苦于以下问题:Python PdfFileWriter._addObject方法的具体用法?Python PdfFileWriter._addObject怎么用?Python PdfFileWriter._addObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyPdf.PdfFileWriter的用法示例。


在下文中一共展示了PdfFileWriter._addObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: about

# 需要导入模块: from pyPdf import PdfFileWriter [as 别名]
# 或者: from pyPdf.PdfFileWriter import _addObject [as 别名]
# Store the last one
item = output._objects.pop()
# delete the one we don't care about (send to the last one)
output._objects.pop()
# Create a new object for the Properties...
properties = pdf.DictionaryObject()
properties.update ({
  pdf.NameObject("/Title"): pdf.createStringObject(u"Nothing to see here"),
  pdf.NameObject("/Producer"): pdf.createStringObject(u"Python PDF Library - http://pybrary.net/pyPdf/"),
  pdf.NameObject("/Author"): pdf.createStringObject(u"Kenneth Wilcox"),
  pdf.NameObject("/Subject"): pdf.createStringObject(u"Headaches are fun"),
  pdf.NameObject("/Creator"): pdf.createStringObject(u"Ken's gen.py script"),
  pdf.NameObject("/Keywords"): pdf.createStringObject(u"what the hell - does this work")
  })
# Add It
output._addObject(properties)
# Add back the one we deleted first
output._addObject(item)

address = PdfFileReader(file("input\\address\\"+fname, "rb"))
location = PdfFileReader(file("input\\location\\"+fname, "rb"))

print "Location Pages:", location.numPages
print "Address Pages:", address.numPages

if location.numPages > 1 :
  print "Location has more than 1 page, exiting..."
  sys.exit()
  
page = location.getPage(0)
for i in xrange(address.numPages):
开发者ID:CanyonCounty,项目名称:MailingCards,代码行数:33,代码来源:gen.py


注:本文中的pyPdf.PdfFileWriter._addObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。