PDF files as email attachment Please Login to Remove! HI
I'm thinking about building an app which would generate a PDF file & send it out as an email attachment. I know that Blackberry's can read PDF files, but I don't know the first thing about how to generate one programmatically, or if it's feasible to do on a Blackberry. Anyone have any ideas on this, and/or where I'd go for info?
Iam able to generate other file formats like .doc and .xml succesfully and send it out as attachment.....
Here is the piece of code that generates a doc file and attach it with the mail...
----------------------------------------------------------------------- String s = "Test Data";
byte[] buf = s.getBytes(); // The attachment.
Multipart multipart = new Multipart();
SupportedAttachmentPart attach = new
SupportedAttachmentPart( multipart,"application/x-example",
"filename.doc", buf);
multipart.addBodyPart(attach);
--------------------------------------------------------------------------
But if i change the extension of filename to .pdf(instead of .doc), the mail is sent along with the pdf attachment, but the pdf is not in correct format and the string "Test Data" is also not displayed.
Thanks in advance for any info..... |