gpt4 book ai didi

ios - 将标注类型注释添加到iOS PDFTron库

转载 作者:行者123 更新时间:2023-12-01 19:47:57 25 4
gpt4 key购买 nike

我面临一个问题,其中iOS的PDFNET框架成功渲染了由其他平台制作的标注类型注释。但是我无法允许iOS应用的用户从一开始就进行相同的注释。

最佳答案

这是一个如何使用PDFNet创建标注注释的程序化示例:

    let txtannot: PTFreeText = PTFreeText.create(doc.getSDFDoc(), pos: PTPDFRect(x1: 100, y1: 100, x2: 350, y2: 500))
txtannot.setContentRect(PTPDFRect(x1: 200, y1: 200, x2: 350, y2: 500))
txtannot.setContents("\n\nSome swift brown fox snatched a gray hare out of the air by freezing it with an angry glare." +
"\n\nAha!\n\nAnd there was much rejoicing!")
txtannot.setCalloutLinePoints(withKneePoint: PTPDFPoint(px: 200, py: 300), p2: PTPDFPoint(px: 150, py: 290), p3: PTPDFPoint(px: 110, py: 110))
txtannot.setBorderStyle(PTBorderStyle(s: e_ptsolid, b_width: 1, b_hr: 10, b_vr: 20), oldStyleOnly: true)
txtannot.setEndingStyle(e_ptClosedArrow)
txtannot.setColor(PTColorPt(x: 0, y: 1, z: 0, w: 0), numcomp: 3)
txtannot.setQuaddingFormat(1)
first_page.annotPushBack(txtannot)
txtannot.refreshAppearance()

(可以在其他示例项目中或在 PDFTron's website上找到Obj-C版本。)

如果您希望以交互方式创建标注注释,则需要创建一个新的“工具”。用于iOS的UINet小部件的所有PDFNet和注释创建/编辑方法都是 /Lib/Tools中的开源框架Tools.framework的一部分。通过使用现有工具作为指南(可创建自由文本注释,文本标记注释,填充表单,签名文档等),您可以创建一个新工具来交互式创建标注注释。

公开:我为PDFTron工作。

关于ios - 将标注类型注释添加到iOS PDFTron库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47511009/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com