Completed
Last Updated: 23 Nov 2016 12:39 by ADMIN
ADMIN
Nikolay
Created on: 19 Apr 2013 08:30
Category: PdfViewer
Type: Feature Request
7
ADD. RadPdfViewer - Implement Save As command and add Save As button
Add an option to save and/or email document. It is especially useful if a file stream is loaded into the viewer.

Currently, the following approach can be used: 
private Stream GetPdfStream()
{

Type documentType = this.radPdfViewer1.PdfViewerElement.Document.GetType();

FieldInfo internalDocumentField = documentType.GetField("internalDocument", BindingFlags.NonPublic | BindingFlags.Instance);

object internalDocumentValue = internalDocumentField.GetValue(this.radPdfViewer1.PdfViewerElement.Document);

FieldInfo formatProviderField = internalDocumentValue.GetType().GetField("formatProvider", BindingFlags.NonPublic | BindingFlags.Instance);

PdfFormatProvider formatProvder = formatProviderField.GetValue(internalDocumentValue) as PdfFormatProvider;

FieldInfo field = formatProvder.GetType().GetField("stream", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance);

Stream stream = field.GetValue(formatProvder) as Stream;
return stream;
}
3 comments
ADMIN
Ralitsa
Posted on: 23 Nov 2016 12:39
In our next official release (R1 2017), we will introduce a build-in 'Save as' option in RadPdfViewerNavigator. We will also provide a way to save the document to a pdf file or a stream using the public API of RadPdfViewer. 

We can suggest to use one of the following online sources demonstrating how to achieve sending an email with attachment: 
http://stackoverflow.com/questions/1195111/c-sharp-mailto-with-attachment 
http://www.codeproject.com/Tips/165548/C-Code-snippet-to-send-an-Email-with-attachment-fr
ADMIN
Stefan
Posted on: 22 Jan 2016 10:30
Hi Mi Ha,

the idea of this request, is when you have loaded a pdf as a stream into RadPdfViewer, to be able to save it as pdf document and to be able to send this pdf document as attachment with your default email app.
Mi
Posted on: 21 Jan 2016 14:27
Well, I would also like to see a component like this. But first of all the question is, is it enough to create a .EML file so Outlook or Thunderbird could process the email? 

Or should a complete new component be created which supports MAPI, Extended MAPI (XMAPI) and Simple MAPI (SMAPI)? If you mean this, you should also think about SMTP and maybe Exchange ActiveSync Protocol!