Hi Liat,
Sorry for the delay in getting back to you. Can you please clarify your requirements, Do you need to remove all pages of the pdf document and then add some new contents to the pdf.
Here is a sample for doing this:
Sample.zip
Please take a look and let me know if you have any questions.
Thanks,
Ajish.