How to copy a page into a PdfStamper? #1038
Unanswered
jon-m-craig
asked this question in
Q&A
Replies: 1 comment 1 reply
-
This is the code where you get a NullPointerException: Can you please study this code in the replacePage() method, and possibly this code can be improved by adding a check if the dic2 variable is null. Next can you test this change, and possibly make a pull request to fix this problem? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I have a PDF template of a pre-printed form (it's a medical insurance form) - it has fields for everything. I use a
PdfStamper
to fill out the fields - and all is fine.Sometimes, though, I need to add a page because the form needs another copy of one of the pages.
So I'm doing,
This seems like it would copy page 1 from the
reader
into the just-newly-created page x+1 in thestamper
and all would be fine. Problem is, instead it throws an exception:I'm not sure what the issue is - there's definitely a page 1 in the reader, so I'm not sure why anything is null.
Maybe I'm going about the page copy in the wrong way; is there a suggested/better way to handle it?
Beta Was this translation helpful? Give feedback.
All reactions