Merging doc without saving

Merging doc without saving

Forum member · Jun 13, 2006
Hi I am using a MergerDocument which has form init.I am filling the contents of the form using .setValue for FormField class. Now I am not able to write the same to another document by getting this pages without using draw() method. The following is scenario Document objDoc=new Document(); MergeOption mergeOpt=new MergerOption(true);\ MergeDocument mergeDoc=new MergeDocument("C:/template.pdf",mergeOpt); mergeDoc.getForm().getFields().getFormField("Name").setValue("Test"); //Writing to doc objDoc.getPages().add(mergeDoc.getPages.getPage(0)); //Writing to disk objDoc.draw("C:/testFile.pdf); ------------ I am getting null pointer xception in the last line. Why is it happening so ?

Re: Merging doc without saving

Support · Jun 13, 2006
This could be happening if the name of the form field that you are referencing is not correct. Verify that a form field does exist on the PDF called "Name" (it is case sensitive). If that is not the problem or you can not figure it out then go ahead and send you PDF over to [^a|mailto:support@cete.com|support@cete.com^]. We can take a closer look at it. Also verify that you are using the latest build. If you sent an email over make sure to mention the exact build number that you are using. Thanks, ceTe Software Support Team