This is fairly straightforward and there are a few examples available on the internet but basically here is how to proceed to send it as a pdf attachment:
var docName = DocumentApp.openById(docID).getName();
var pdf = DocsList.getFileById(docID).getAs('application/pdf').getBytes();
var attach = {fileName: docName+".pdf",content:pdf, mimeType:'application/pdf'};
MailApp.sendEmail(emailadress, 'Your document as PDF ('+docName+')', 'see attachment', {attachments:[attach]});
I hope this example is clear enough.
EDIT : following your comment, I think this post by Henrique on the old Google group forum should fulfill your needs.( It's a workaround that I use a lot in many scripts and it works beautifully... the only annoying detail is that it needs to be authorized from the script editor (not the usual red border popup).
Here is how it goes :
function emailDocTest() {
var id = 'Doc-Very-Long-ID-Here';
var url = 'https://docs.google.com/feeds/';
var doc = UrlFetchApp.fetch(url+'download/documents/Export?exportFormat=html&format=html&id='+id,
googleOAuth_('docs',url)).getContentText();
var emailAdress = Session.getEffectiveUser().getEmail();
MailApp.sendEmail(emailAdress, 'test doc send by mail as html', 'html only', {htmlBody:doc});
}
function googleOAuth_(name,scope) {
var oAuthConfig = UrlFetchApp.addOAuthService(name);
oAuthConfig.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken?scope="+scope);
oAuthConfig.setAuthorizationUrl("https://www.google.com/accounts/OAuthAuthorizeToken");
oAuthConfig.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken");
oAuthConfig.setConsumerKey('anonymous');
oAuthConfig.setConsumerSecret('anonymous');
return {oAuthServiceName:name, oAuthUseToken:"always"};
}