views:

8439

answers:

4

I've already referred to this: http://stackoverflow.com/questions/104177/how-do-i-embed-an-image-in-a-net-html-mail-message

I've been embedding images using an AlternateView for PNG files. Now I'm wondering how to do it with PDFs.

Should it work, for the LinkedResource, to just say:

Dim document As New LinkedResource(pdfFilePath, "image/pdf")

I'm just trying to figure out how to get the PDF to be embedded like I could with an image, or is that not possible and I'll have to do it as an attachment?

+2  A: 

You can embed images since they can be rendered in place by an email client. PDFs cannot do that, so I'd recommend either having a thumbnail of the PDF that links to your web site with the actual PDF. Or just attach the PDF to the email message.

DavGarcia
+1  A: 

This is not possible--at least not in a way that will work with many clients. You'll need to just attach the file.

If you have only one client to worry about, it might be possible--but not likely without manually changing settings on each client.

Michael Haren
+1  A: 

There are a few options that I know of.

1) Is the simplest way okay? The easiest by far would be to attach the PDF as a normal attachment. Then render the first page of the pdf as an image, embed it in the email and link it to open the PDF if you can. Entourage kind of does this on the Mac.

Alternatively, what I found was the following:

2) FLASHPAPER embedded in HTML displaying a PDF. Adobe has a technology called Flashpaper. It is a flash based file viewer. You can use flashpaper format documents that go into it, or PDFs as the source.

Check out some examples. That's really flash. http://www.adobe.com/products/flashpaper/examples/

Assuming you send an HTML email that will get through (images aren't turned off, etc), you can can embed the Flashpaper viewer right in your HTML code as a normal Flash object.

Most HTML email clients use Internet Explorer Bits, Webkit bits, or Gecko bits to render the html. Flash player is pretty well installed on everything, so it works well. A good example of this is when we open an email and it has video playing in it. It's almost always Flash.

I have had luck doing it this way -- the only thing you'd have to decide is if most of your clients can see this and how much (if any) today's software might block it.

What I ended up doing was a hybrid. 1) Attach it to the email, 2) Embed the Flashpaper viewer. They get it either way.

Flashpaper is available seperately for $75. It has come in handy where the client was not able to install adobe acrobat on each computer and it had to be 100% web based.

I would imagine you should be able to do the same using any language with a little more effort and using something like Flashpaper.

Hope that helps

Jas Panesar
"Flashpaper viewer right in your HTML code as a normal Flash object" - how do you do this without swfobject? Satay?
bzlm
A: 

The MIME type of a PDF is "application/pdf" not "image/pdf"

Chris Nava