WebView and PDFs

I am using a WebView in my app to view individual pdfs that are located on web servers where I work. I’ve gotten it working (the pdfs open using the PDF Viewer plugin), but something annoying keeps happening: Under a number of circumstances (typically after re-launching==but not always), it seems to forget what helper application to use and prompts me to locate a viewer (I choose the Acrobat Reader 8 application). I would like this choice to be stored so the user isn’t constantly burdened with re-selecting the helper ap.

I’ve been using Applescript Studio on & off for a while, but this is my first use of the webview, and I would have assumed it would just honor the mime settings on the Mac. I do have Default Apps prefpane (RCDefaultApp) installed and can verify that Acrobat Reader 8 is the default for “application/pdf” but the webview just doesn’t seem to recognize that.

In checking the Cocoa docs for webView I notice the registerViewClass:representationClass:forMIMEType: method. But I’m not a Cocoa programmer, so I’m not sure whether that’s what I need or how to use it. I’m hoping someone could provide assistance in that direction.

Although, while checking online, I see there’s also an extra PDFKit.palette that can be added to Interface Builder. I was thinking of trying that as well, but I can’t find any example that use that in applescript studio. Also, my guess is that would use Apple’s PDF viewer engine (Preview) which would work, but Acrobat Reader 8 would be my preference.

Anyone?

Model: iMac G5
AppleScript: AS Studio/XCode 2.1
Browser: Safari 3.1
Operating System: Mac OS X (10.4)

Slight update. I installed and started using Acrobat Reader 9 (instead of version 8) and it hasn’t been asking to re-locate the viewer application. So maybe that problem was associated with Acrobat Reader 8.

That said. If anyone is still able to provide advice about using methods to control a webview, I would be very interested. Just some specific compilable examples can help a lot. I’ve been scouring this and other forums, but haven’t found exactly what I’m looking for.

Search of the Web:
I’m trying to do this also, just haven’t gotten to it yet. If you’re looking at single page pdfs I think you can just use a image view box instead of pdf view. NSImage should accept a pdf… I think.

http://developer.apple.com/cocoa/pdfkit.html