Click here to Skip to main content
15,897,704 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear all,

please consider the below scenario.

i have folder in local disk which contain pdf files.i want to overwrite a pdf in that folder using vb.net code.can anyone have any solution?

thanks in advance
Posted
Updated 4-Nov-16 1:55am

To 'overwrite' a file, your program simply open it and write to it (see, for instance "How to: Write Text to a File"[^])
On the other hand, if you need to overwrite it with meaningful info (that is a well formed PDF document), then you probably need a library (Google[^] is your friend).
 
Share this answer
 
Or you delete it and write the new file??
IF System.IO.File.Exists(Path) THEN

System.IO.File.Delete(path)

END IF
 
Share this answer
 
Comments
jai_mca 31-Oct-12 3:58am    
Actually with in the folder i have more than 1 pdf files..when i load one pdf(For eg.,file.pdf) in browser control,the copy of the same pdf(which is renamed as file_copy.pdf) will be loaded in foxit reader for editing.now my problem was,after editing the file_copy.pdf it need to be overwrite in the original(ie,file.pdf).

deleting the original and renaming the copy is not possible.because the original pdf is in progress

how is it possible?thanks in advance..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900