如何取下图所示的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];


所以投射不起作用

最佳答案

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


  //所有注释都必需。页面空间的边界框
  注解。


@property (nonatomic) PDFRect bounds;


哦,这有效

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

10-12 04:30