Skip to content

PDF Form filling #42

Closed
Closed

Description

@braindev

Any plans for PDF form filling? PDF "flattening" would be a nice feature to go along with that.

Thanks!

Activity

  1. hhrutter commented on Sep 20, 2018

    @hhrutter
    Collaborator

    Hi!
    Form filling is definitely in the pipeline.
    What's your definition of "flattening"?

  2. braindev commented on Sep 20, 2018

    @braindev
    Author

    A flattened PDF wouldn't allow the form fields to be edited.

    EDIT:
    I'm borrowing the term from pdftk
    see: https://www.pdflabs.com/docs/pdftk-man-page/#dest-output-flatten

  3. changed the title [-]PDF Form filling?[/-] [+]PDF Form filling[/+] on Nov 14, 2018
  4. zbruhnke commented on Dec 14, 2019

    @zbruhnke

    @hhrutter any timeline around this? It's something we're thinking about as well

  5. StefanSchroeder commented on Sep 23, 2020

    @StefanSchroeder

    @hhrutter Any updates on this issue? Not pushing, just asking.

  6. hhrutter commented on Sep 27, 2020

    @hhrutter
    Collaborator

    Hello!

    I am hard at work and busy providing Unicode/CJKV support.
    Please consider backing pdfcpu as a sponsor if you want to keep this project going.
    The ❤️ button is right at the top of the ReadMe.

    Thank you for using pdfcpu 💚

  7. kben commented on Apr 15, 2021

    @kben

    @hhrutter Thanks for this incredible library, I just found it. Can I somehow support you with Code on this feature?

  8. hhrutter commented on Apr 15, 2021

    @hhrutter
    Collaborator

    👍 Thanks, that's already being worked on.
    Happy to take all your issues once it is released.

  9. self-assigned this
    on Jul 24, 2021
  10. karelbilek commented on Mar 22, 2022

    @karelbilek

    I tried to do PDF form filling myself, and it almost works but doesn't completely.

    The easy part is to go through the PDF form fields and set the correct V field.

    The hard part is to set the AP default appearance.

    I tried to "delete" it and set NeedAppearances. What happens is AcroReader then regenerates some of them, but about half of them still show up empty! And I need to click inside and re-save (which makes NeedAppearances useless...)

    Maybe it's something with this specific form, but some appearances are just not regenerating in Acrobat Reader.

    I lack the knowledge to re-create the AP myself on the form :(

  11. hhrutter commented on Mar 22, 2022

    @hhrutter
    Collaborator

    This feature will be part of the next release.
    Stay tuned 👍

  12. karelbilek commented on Mar 23, 2022

    @karelbilek

    I hope it will include recreating the AP appearances :D and not just relying on NeedAppearances. I see you already do create appearances in a different part of the code (where you create text fields from scratch), so I guess you already have that :)

    NeedAppearances seems a bit buggy, at least in Acrobat. I tried to study how AP streams work, and where to get the fonts reference, and my brain got too tired. :) I tried to look how iText does that and 💀 so complex. (And it is buggy too.)

    yes looking forward to that. Btw pdfcpu is a great package, it allowed me to look inside PDF and play with it. Thanks a lot

  13. eduardo-mior commented on May 30, 2022

    @eduardo-mior

    I'm looking forward to it.

    Any predictions for when this will be released?

    @hhrutter I am very grateful for your work.

  14. dingyaguang117 commented on May 31, 2022

    @dingyaguang117

    @eduardo-mior @karelbilek @braindev @zbruhnke @StefanSchroeder @kben

    Hi guys, I implemented form-filling based on pdfcpu's low-level API. Just for reference.

  15. hhrutter commented on May 31, 2022

    @hhrutter
    Collaborator

    It is being worked on. See above.

  16. karelbilek commented on May 31, 2022

    @karelbilek

    @dingyaguang117 huh interesting. Is "watermark" how it fills the AP appearance streams? Or is it a different thing?

  17. dingyaguang117 commented on May 31, 2022

    @dingyaguang117

    @dingyaguang117 huh interesting. Is "watermark" how it fills the AP appearance streams? Or is it a different thing?

    Filling-form is based on modifing the value of V key (Text Field) and AS key(Button Field) in annotations.

  18. 0q2 commented on Jan 6, 2023

    @0q2

    It's been four years, any updates?

  19. hhrutter commented on Jan 6, 2023

    @hhrutter
    Collaborator

    This is part of the upcoming release which is all about form processing.
    Please bear with me 🙏

  20. hhrutter commented on Mar 1, 2023

    @hhrutter
    Collaborator
  21. karelbilek commented on Mar 2, 2023

    @karelbilek

    Hah good. As I promised to you one time on slack, I will try various PDFs I have to get you bugs for this, if I find them

  22. kben commented on Mar 3, 2023

    @kben

    Hi, I just had the change to try the new implementation. But get the following error when trying to fill a textfield:

    writing x.pdf...
    pdfcpu: dict=<<
    <AP, <<
    <N, (757 0 R)>
    >>>
    <DA, (/Helv 12 Tf 0 g)>
    <F, 4>
    <FT, Tx>
    <Ff, 0>
    <P, (741 0 R)>
    <Rect, [413.50 545.75 565.20 568.80]>
    <Subtype, Widget>
    <T, (Textfield-5)>
    <TU, (857 0 R)>
    <Type, Annot>
    <V, (��FDSA)>

    entry=MK missing.

    Any idea what's happening here?

  23. hhrutter commented on Mar 4, 2023

    @hhrutter
    Collaborator

    Not sufficient for analysis.
    I need to see more of what you are doing
    an please open a new issue.

  24. kben commented on Mar 4, 2023

    @kben

    Using the follwoing PDF:

    • doing a form export
    • modify a textfiled
    • try to fill the pdf

    https://www.aok.de/pk/magazin/cms/fileadmin/pk/rheinland-hamburg/pdf/antrag-leistungen-pflegeversicherung.pdf

  25. hhrutter commented on Mar 4, 2023

    @hhrutter
    Collaborator

    Hi!
    Are you trying to modify a PDF form that was not created with pdfcpu?
    Then issues are expected and need to be followed up.
    Please open a new issue.
    Thank you!

  26. enahs commented on Mar 5, 2023

    @enahs

    @kben please link the issue here. seeing a similar problem on a 3rd party pdf fill.

  27. kben commented on Mar 5, 2023

    @kben

    See bugreport #571

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions