Skip to main content
Participant
June 3, 2009
Question

How do I clear the file from AxAcroPDF object?

  • June 3, 2009
  • 5 replies
  • 24701 views

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 has been closed for replies.

5 replies

fanaticosrding
Participant
June 4, 2018

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%

Participant
March 21, 2017

AxAcroPDF1.LoadFile("none")

Kenstanley2014
Participant
October 29, 2014

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.

maginal
Participant
December 16, 2015

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

Participant
July 2, 2009

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.

Participant
July 12, 2009

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

Participant
August 8, 2009

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

Participating Frequently
June 4, 2009

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?