New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: return structs #621
Comments
Hi! Interesting, please explain your usecase. |
Just facing the same problem. Having an "API", I thought ListImages would indeed return raw information, and the presenting layer (CLI) would then use that raw information to print out. Instead, ListImages returns formatted strings. Use case: I am generating PDFs using different tools, and I need to test the result. The pdfcpu API part sounded interesting, but it is not really useful if you got to parse strings. Without breaking things, maybe introduce an SDK, which has all or most functions, but returns indeed (list of) objects? Like in my case |
I would also love this. Currently I am using the library to fetch the form fields using |
I am going to take up your suggestion, but I am doing this across the board for the whole API. |
This is part of https://github.com/pdfcpu/pdfcpu/releases/tag/v0.5.0 |
pdfcpu/pkg/pdfcpu/annotation.go
Line 209 in 0342a83
currently, the
ListAnnotation
API returns a string array and each element in the array represents a line in the formatted output.The extra parsing work is very inconvenient for the downstream program to integrate with this API.
What do you think about splitting the output format logic and annotations list logic? The API can return a Golang object and the
cmd
module can cover the formatting work.The text was updated successfully, but these errors were encountered: