With the ComponentOne PDF for Windows Phone class library you can create PDF documents in code and save them out to a stream. The following code snippet shows how to create a simple document and load it into C1PdfViewer without having to save it into isolated storage or put on the Web:
Public Sub New()
InitializeComponent()
' create new C1PdfDocument
Dim doc As New C1PdfDocument()
' add some content to PDF
doc.DrawString("Hello World!", New Font("Arial", 14), Colors.Black, doc.PageRectangle)
' save PDF to memory stream
Dim ms As New MemoryStream()
doc.Save(ms)
' load PDF from stream
ms.Seek(0, SeekOrigin.Begin)
c1PdfViewer1.LoadDocument(ms)
End Sub
•C#
public MainPage()
{
InitializeComponent();
// create new C1PdfDocument
C1PdfDocument doc = new C1PdfDocument();
// add some content to PDF
doc.DrawString("Hello World!", new Font("Arial", 14), Colors.Black, doc.PageRectangle);
// save PDF to memory stream
MemoryStream ms = new MemoryStream();
doc.Save(ms);
// load PDF from stream
ms.Seek(0, SeekOrigin.Begin);
c1PdfViewer1.LoadDocument(ms);
}
What You've Accomplished
In this example you've loaded PDF files into the C1PdfViewer control rom the Web.