gpt4 book ai didi

ios - iOS 中的 PDFKit 注释框架的注释字典值返回 NSRect

转载 作者:行者123 更新时间:2023-11-29 05:19:22 29 4
gpt4 key购买 nike

如何获取如下所示的 NSRect 值并将其转换为 CGRect?

{
"/A" = (null);
"/Border" = "PDFBorder: {solid lineWidth:1.0 hCorner:0.0 vCorner:0.0 dashCount:0 dashPattern:(\n)}";
"/DA" = "/Helvetica-Bold 12 Tf 0 g";
"/F" = 4;
"/FT" = "/Btn";
"/Ff" = 65536;
"/MK" = "<PDFAppearanceCharacteristics: 0x600002702eb0>";
"/Rect" = "NSRect: {{61.825100000000006, 230.45099999999999}, {212.82389999999998, 38.096000000000032}}";
"/Subtype" = "/Widget";
"/T" = "signature_af_image";
"/Type" = "/Annot";
}

这是有问题的值:

"/Rect" = "NSRect: {{61.825100000000006, 230.45099999999999}, {212.82389999999998, 38.096000000000032}}";

我尝试像这样进行转换,虽然这似乎有效,但 CGRect 内的值与 NSRect 内的值不匹配。它们的大小为 10^30

CGRect tempRect = (__bridge CGRect)[annot.annotationKeyValues objectForKey:PDFAnnotationKeyRect];

所以转换不起作用

最佳答案

我是个白痴,答案已经在文档中了

// Required for all annotations. The bounding box in page-space of the annotation.

@property (nonatomic) PDFRect bounds;

哦,好吧,这有效

关于ios - iOS 中的 PDFKit 注释框架的注释字典值返回 NSRect,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58824438/

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