Skip to main content
Participant
Jun 3, 2009 6:59 PM UTC
Question

How do I clear the file from AxAcroPDF object?

Hi all,

I can't seem to solve this problem.
I am writing a C#  desktop app that lets a user view a PDF file and then the user will have an option to delete that file.

I first call the LoadFile("FileName") Function.
My problem occurs when the user has finished deleting the file I can't figure out a way to clear the document from the AxAcroPDF object.
It has been really bothering me.

I need to figure out how to clear the document from the AxAcroPDF object.

Could some one please help me out?


Thanks In advance.
-Adi

This topic is closed to new replies. Start a new post to keep the conversation going.

9 replies

fanaticosrding
Participant
Jun 4, 2018 9:31 PM UTC

Aunque ya hay varias respuestas  que funcionan...

mi solución fue enviarle un objeto vació al componente..

AxAcroPDF1.LoadFile ("nombre.pdf");

con  la extensión .pdf

y funciona 100%

Translate
Participant
Mar 21, 2017 8:57 PM UTC

AxAcroPDF1.LoadFile("none")

Translate
Kenstanley2014
Participant
Oct 29, 2014 1:48 AM UTC

All you need to do is load a pdf that does not exists. I found this out by mistake by mistyping my pdf file name.

 

AxAcroPDFobject.LoadFile("DONTEXISTS.pdf")

 

This will return the pdf viewer to blank status.

Translate
maginal
Participant
Dec 16, 2015 5:57 PM UTC

Obrigado.  Não é que funciona mesmo ...

Translate
Participant
Jul 2, 2009 10:08 AM UTC

Hi there,

i have the same problem as adoh41.

Dont think it what is describting joeln, its about something else.

I load file - function LoadFile(...), but cant find function for unloading it.

I can do everything with loaded file, i can delete it too and component

is still showing loaded file.

Is there any function for unloading file?

Really need it too.

Thanks.

Translate
Participant
Jul 12, 2009 3:39 PM UTC

Hi, I have the same problem, writing a C# application. I load the file with axacroPDF.LoadFile("File name")

but after I tried to unload the file in many kind of way but without success.

I tried also loading a null file with the command axacroPDF.LoadFile(null).

After I tried to delete the object (axacroPDF.Dispose) and to recreate it in the Form but it doesn't seem to work!!

I hope someone finds the solution,

thanks

Translate
Participant
Aug 8, 2009 7:11 AM UTC

Hi Herm,

i am using now function:

  • axacroPDF.Hide()
  • axacroPDF.Load()
  • axacroPDF.Show()

Dont know about any function as Unload() still , but its functional.

Fortunately it is not working with access rights of files and

i can delete, move or do anything with loading file, what i need.

Good Luck

Tri

Translate
Participating Frequently
Jun 4, 2009 7:56 AM UTC

If you want to delete the file you have to close the pdf and after delete it. While the file is open you can't delete it.

Is it what you want?

Translate