本文主要是介绍关于PyPDF2 3.0.0版本中方法的更新,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
PyPDF2.errors.DeprecationError: mediaBox is deprecated and was removed in PyPDF2 3.0.0. Use mediabox instead.
这里你需要将使用到mediaBox方法的地方,变成mediabox
PyPDF2.errors.DeprecationError: getLowerLeft_x is deprecated and was removed in PyPDF2 3.0.0. Use left instead.
PyPDF2.errors.DeprecationError: getLowerLeft_y is deprecated and was removed in PyPDF2 3.0.0. Use bottom instead.
PyPDF2.errors.DeprecationError: getUpperRight_x is deprecated and was removed in PyPDF2 3.0.0. Use right instead.
PyPDF2.errors.DeprecationError: getUpperRight_y is deprecated and was removed in PyPDF2 3.0.0. Use top instead.
这四个报错是说明需要换新方法,按要求把getLowerLeft_x换成left,getLowerLeft_y换成bottom,getUpperRight_x换成right,getUpperRight_y换成top。
观察其原函数
可以感觉到,其返回的已经是数字了,因此你不需要在函数后面加()或者[0]。否则就报错了。
PyPDF2.errors.DeprecationError: cropBox is deprecated and was removed in PyPDF2 3.0.0. Use cropbox instead.
把cropBox换成cropbox
PyPDF2.errors.DeprecationError: lowerLeft is deprecated and was removed in PyPDF2 3.0.0. Use lower_left instead.
PyPDF2.errors.DeprecationError: upperRight is deprecated and was removed in PyPDF2 3.0.0. Use upper_right instead.
这两个也换一下字母即可。
这篇关于关于PyPDF2 3.0.0版本中方法的更新的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!