iText页码y的x设置不正确

时间:2018-08-20 10:48:41

标签: android pdf kotlin itext

我正在打开文档进行以下操作:

total = writer!!.directContent.createTemplate(30f,16f)

onEndPage:

val img = Image.getInstance(total)
            img.scaleAbsolute(30f,30f) //tried without it as well
            img.setAbsolutePosition(PageSize.A4.width-10,20f)
            document.add(img)
            ColumnText.showTextAligned(writer.directContent, Element.ALIGN_CENTER, Phrase(document.pageNumber.toString()),document.right(20f), document.bottom(), 0f)

最后打开关闭文件:

ColumnText.showTextAligned(total,Element.ALIGN_LEFT, Phrase(" of "+(writer!!.currentPageNumber-1)),document!!.right(20f), document.bottom(), 0f)

例如,我的页码未显示为“ 10之2”。 我刚得到2、3、4 ...等等

0 个答案:

没有答案