我能够添加一个pdf的页脚,使用iOS的TPPDF库。但我不能保持在PDF的每一页的页脚。有没有同样的解决方案?
下面是我是如何使用页脚的:
**让attributedString = NSAttributedString(string:“第1页,共1页”,attributes: regularTextAttributes)
document?.add(.footerLeft,attributedText: attributedString)**
发布于 2021-11-01 08:52:51
您使用的是单个PDFDocument实例,还是最终生成文档中的每个页面都有不同的实例?根据我所看到的,在添加页脚时,整个文档(PDFDocument实例)与通过PDFGenerator生成最终文档是一样的,但如果使用文档数组(许多PDFDocuments)并通过PDFMultiDocumentGenerator生成最终文档,则需要将页脚添加到每个PDFDocument
注意:如果您使用的是PDFMultiDocumentGenerator,那么文档的默认分页可能会出现问题,需要使用customClosure PDFPaginationStyle手动处理分页的“页面”和“总计”
https://stackoverflow.com/questions/65319600
复制相似问题