Merging doc without saving

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Merger for Java (v3.x and older)  /  Display Thread

DynamicPDF Merger for Java (v3.x and older) Forum

 Jun 13 2006 9:14 AM
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 ?
 Jun 13 2006 2:08 PM
Posted by a ceTe Software moderator
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 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

All times are US Eastern Standard time. The time now is 9:19 AM.