The usual process for handling PDFs in Tridion is:
Create a new Multimedia component, based on the schema you use for PDFs in your environment
Save and close the new component
Publish the PDF to the file system by either:
- Publishing the new Component directly (and having a dynamic Component Template associated with the schema its based on)
- Adding the Component to a page either directly, or as a Component link field of a component that is already on a page.
Whichever method you use there will be some template logic that handles the publishing.
Every time the PDF is published Tridion maintains a reference count in the Broker database.
When the PDF gets unpublished the reference count is reduced, and once it hits zero the PDF will be removed from the file system.
So, to remove the PDF from the file system you just need to make sure all instances of it are unpublished. Is it used on more than one page perhaps? Try doing a 'Where used' on the component to track this down.
However, it looks like you don't want to delete the PDF - just update it?
Once you've updated your PDF in the CMS (in your multimedia component), you just need to re-publish the PDF using whatever publish mechanism you used in the first place.
This will then overwrite the existing PDF on the file system.
It looks like you are using the Core Service to work with your PDFs? If the above doesn't help you please share your code, and more specific details of the problems you are having.
Update (Code sample added to question)
From the code provided in your updated question, there's no reference to the Core Service, it seems you are trying to interact directly with the PDFs on the file system?
This is not how Tridion works. As explained above you need to manage your Components in the Content Manager, and then use the Tridion publishing process to create, update and remove the PDFs from the file system.
If you need to script this process you can use the Core Service to create PDFs in the CMS, and then Publish them to file system.
It appears you might be missing some of the foundations of working with Tridion - thats not something that can be covered in full here. I'd recommend engaging with a Tridion partner to cover some of this with you. In addition to that, there's a lot that would help you here: http://sdllivecontent.sdl.com/ (login required)