How can I use the PoDoFo library for annotating PDFs on iOS?

前端 未结 2 1660
我在风中等你
我在风中等你 2021-01-06 02:57

I would like to annotate PDFs within an iOS application. I came across the PoDoFo library, but I\'m not sure how to use this in an iOS application.

Is it possible t

2条回答
  •  囚心锁ツ
    2021-01-06 04:00

    The Above answer only provides you way to add Annotations (of Type FreeText etc). Generally you would want to create/Modify Fields. I normally use PdfTextFields, PdfCheckboxes, PdfSignature Field for this purpose. Hope that helps

        PdfMemDocument memDoc;
        PdfFileInputStream fileInputStream(filePath);
        char *srcBuffer = new char[fileInputStream.GetFileLength()];
        size_t srcLen = fileInputStream.GetFileLength();
        fileInputStream.Read(srcBuffer,srcLen);
    
    
        PdfOutputDevice outputDevice(filePath);
        outputDevice.Write(srcBuffer,srcLen);
        memDoc.Load(srcBuffer,srcLen);
    
        PdfTextField txtField  = PdfTextField( pPage,PdfRect(50, 50, 50, 50),&memDoc);
        txtField.SetFieldName(@"SomeUniqueName");
    
        memDoc.Write(&outputDevice);
        outputDevice.Flush();
    

提交回复
热议问题