3

I have an AxAcroPdf component in my C#.Net application which loads a pdf from a url:

pdfViewer.src = previewUrl;

When there is nothing at that URL the component hangs. I have tried adding a timer which checks a boolean value which is updated after the pdf is loaded, but the AxAcroPdf component loads from a URL in a background thread which is inaccessible to me, so this approach does not work.

As far as I can tell the component does not provide any methods for checking on the progress of getting a pdf from a URL.

My final option is to download the pdf separately, then use the loadFile method instead, but I would prefer to avoid doing this if possible because the information contained in the pdf is sensitive so I would prefer not to be putting a copy of the pdf on my users PCs.

Any ideas?

Edit: The pdf is generated by a Mule service, so looking at the URL twice is not really an option either as it puts an unacceptable load on the server.

Carasel
  • 2,740
  • 5
  • 32
  • 51

1 Answers1

1

Your application could test the URL itself for any timeouts/404's. Then if it's ok, proceed with the pdf code.

Harry
  • 2,429
  • 4
  • 21
  • 26
  • Thanks. Unfortunately the pdf is generated by a Mule service, so I can't really look at the URL twice without putting a big load on the server. I'll give you the vote though, as you answered the question I asked. – Carasel Sep 06 '13 at 09:29