unidoc / unipdf

Golang PDF library for creating and processing PDF files (pure go)
https://unidoc.io
Other
2.56k stars 251 forks source link

[BUG] field partial name (T) not specified #425

Closed tangximing closed 2 months ago

tangximing commented 3 years ago

Description

I'm trying to read form from pdf with code below, but ends up with error like this "field partial name (T) not specified"

ReadForm(arg *ReadFormArg) (resp string, err error) {
    fd, err := fjson.LoadFromPDFFile(arg.Filename)
    if err != nil {
        return
    }
    if fd == nil {
        return
    }
    resp, err = fd.JSON()
    if err != nil {
        return
    }
    return
}

Expected Behavior

parse the pdf successfully and return form json string

Attachments

there are two form fields in pdf attachment, and the second one is just copied from the first one. if I replace the second one with created form field not copied, it's ok.

test2.pdf

gunnsth commented 2 years ago

@tangximing We cannot reproduce this. Can you test this again with newest unipdf and provide a self-contained example with full code and files so that it can be reproduced.