Generate Multiple PDF pages with iText


I have attached a PDF...  It was generated through using iText.  I need additional help on two items to continue my project.  

1.  How to take my completed PDF, and "flatten" the fields so no changes can be made.
2.  Complete this Master form, and fill in the additional "BOXES" on the form...  I CAN do this with iText using the PdfStamper object through the AddAnnotation...  The hard part for me is to add pages (Master Form as the base for subsequent pages) AND then fill in details on each added page (hope this is clear).

I have purchased the iText in action book by Bruno Lowagie, and have found some references to "addpage"; however, my attempts are falling short...  I can add a page, but it is just a blank page.... not sure how to add a page with the added page being the Master.pdf.... And not sure how to add fields on the newly added page...???

Hopefully someone can point me in the right direction....  

Thanks in advance
Rick Norris
Rick NorrisAsked:
Who is Participating?
Rick NorrisConnect With a Mentor Author Commented:
I was wanting more than just how to make fields "not editiable"... and have not tried to test the code given by Dushan911.

I am closing this question now....  I determined that I needed more personal attention, and contacted another member directly....  

I will not be posting the solution, because it is very extensive, and this is one that I PAID FOR the other members expertise....  It was worth every dollar that I spent, and more!!

Rick Norris
Dushan De SilvaTechnology ArchitectCommented:
1. Use noEdit function to stop editable fields and pages.
// Can't edit the fields of the form to prevent further changes to the data

function noEdit(  )
//	console.println("noEdit!<wbr ></wbr><wbr ></wbr><wbr ></wbr>!");
	for (var nPageCount = 0; nPageCount <; nPageCount++) 
		// Get the field containers from each page
		var oFields = xfa.layout.pageContent(nPa<wbr ></wbr><wbr ></wbr><wbr ></wbr>geCount, "field");
		var nNodesLength = oFields.length;
		for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) 
			if (oFields.item(nNodeCount)!<wbr ></wbr><wbr ></wbr><wbr ></wbr>=this) 
				oFields.item(nNodeCount).a<wbr ></wbr><wbr ></wbr><wbr ></wbr>ccess = "protected";
//	console.println("form can not edit!");

Open in new window

Rick NorrisAuthor Commented:
I contacted another member for a paid solution
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.