In my view, users can search for a document and once they get the result, they can click on its id and they can download the document from specific url based on id: http://test.
If the PDF file is generated on an external site, you will need to download it in some way, for this you can use WebClient:
var client = new WebClient();
// Download the PDF file from external site (pdfUrl)
// to your local file system (pdfLocalFileName)
client.DownloadFile(pdfUrl, pdfLocalFileName);
Then you can use it on Attachment:
attachment = new Attachment(pdfLocalFileName, MediaTypeNames.Application.Pdf);
msg.Attachments.Add(attachment)