} // For each page token
// We replace original page content by the edited one.
PDStream updatedPageContents = new PDStream(inputFile);
ContentStreamWriter contentWriter = new ContentStreamWriter( updatedPageContents.createOutputStream() );
contentWriter.writeTokens( editedPageTokens );
currentPage.setContents( updatedPageContents );
} // For each document page
}