快速的PDFView不显示填充的pdf表单

我有一个PDF文件,其中包含要填写的字段。并用以下代码填充它们:

PDFDocument *documento = [[PDFDocument alloc] initWithData:dataFile];

for (int index = 0;index<documento.pageCount;index++) {
            PDFPage *page = [documento pageAtIndex:index];
            if (page != nil) {
                NSArray *annotations = [[NSArray alloc] initWithArray:page.annotations];
                for (PDfannotation *annotation in annotations ){

                    PDfannotation *annTemp = annotation.copy;
                    [annTemp setvalue:[dizionarioForm objectForKey:[json objectForKey:annotation.fieldName]] forAnnotationKey:PDfannotationKeyWidgetvalue];

                    [page removeAnnotation:annotation];
                    [annotation setShouldDisplay:false];
                    page.displaysAnnotations = false;
                    [page addAnnotation:annTemp];


                }
            }
        }

        self.pdfView = [[PDFView alloc] initWithFrame:self.view.frame];
        self.pdfView.displayMode = kPDFDisplaySinglePage;
        self.pdfView.autoScales = true;
        self.pdfView.displayDirection = kPDFDisplayDirectionVertical;
        self.pdfView.document = nil;
        self.pdfView.document = documento.copy;
        UIViewController *pdfVC = [[UIViewController alloc] init];

        [pdfVC.view addSubview:self.pdfView];
        pdfVC.navigationItem.rightBarButtonItem =  [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemaction target:self action:@selector(pdfViewAzioni)];
        [self.navigationController pushViewController:pdfVC animated:true];

但是,显示时,字段为白色,并且仅当我选择该字段时,该值才会显示... 如何立即显示该值? 谢谢。

hufu1971 回答:快速的PDFView不显示填充的pdf表单

设置注释的背景颜色对我有用。选择的颜色似乎无关紧要。

本文链接:https://www.f2er.com/3042321.html

大家都在问