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
[Feature] QPDFFormFieldObjectHelper setFormFieldName #578
Comments
Please see general contributing guidelines. I don't have time or need to implement this feature myself (PDF is too big for one person), but I can support your work on a PR. embeddedfiles.cpp is probably close as to a template since it creates the pikepdf Attachments class which binds QPDFEmbeddedFileDocumentHelper, and several object QPDF*ObjectHelper classes. At a glance, it's possible a property acroform.cpp would similarly succinct and straightforward - a lot of the time the C++ code is giving Pythonic names to C++ methods. Object helpers must specify shared_ptr as their holder type or you will get lots of segfaults. Document helper must omit this, because it uses the default unique_ptr. The entire class hierachy has to use the same holder type or everything goes boom. py::class_<QPDFEFStreamObjectHelper,
std::shared_ptr<QPDFEFStreamObjectHelper>, // <--- holder type spec
QPDFObjectHelper>(m, "AttachedFile") You'll also to ensure QPDF has several functions that return |
@jbarlow83 Ok thank you I'll look into it and submit a PR asap |
I started to try implementing the method here : https://github.com/pikepdf/pikepdf/pull/580/files But I dont understand what I'm doing wrong, I have this error message :
Could you help me understand it ? 🙏 |
I suspect the error is due to QPDFAcroFormDocumentHelper not being a subclass of QPDFObjectHelper. |
I would like to add the method setFormFieldName of QPDFAcroFormDocumentHelper :
https://github.com/qpdf/qpdf/blob/main/libqpdf/QPDFAcroFormDocumentHelper.cc#L154
https://github.com/qpdf/qpdf/blob/58c31fdd5e9e633281cb6830d63427da050fbe41/include/qpdf/QPDFAcroFormDocumentHelper.hh#L107
But I dont really know well pybind11, where should I start to make my PR. Is there an example of a method from this QPDF class already implemented ?
The text was updated successfully, but these errors were encountered: