As Dan mentioned, the Q2 SDK is in Python therefore all third party libraries are available. Therefore, using something like his pdfrw library or your own library preference would work fine. You can see additional information about how to get third party libraries here https://docs.q2developer.com/tutorials/online_banking/third_party_libraries.html?highlight=add_dependency
The next step for you may be making those files available for end users. Using the Ardent API section of the Q2 SDK would be our recommended way for that using https://docs.q2developer.com/api_references/q2_sdk/ardent/index.html#module-q2_sdk.ardent.file_upload
Here is a good article that goes into some techniques for writing dynamic data to a fillable PDF in python: https://medium.com/@vivsvaan/filling-editable-pdf-in-python-76712c3ce99 . I have not done this in the SDK but assuming that the library passes Q2's QA and Vulnerability checks, you should be able to add the library to your extension with the q2 add_dependency pdfrw and hit the ground running. I hope that helps.