このクイックスタートでは、FlexViewer コントロールに PDF ファイルをロードする簡単なアプリケーションを作成する手順を説明します。ここでは、C1PdfDocumentSource 製品サンプルに含まれる DefaultDocument.pdf という PDF ファイルを使用します。
次の図に、FlexViewer にロードされた PDF ファイルを示します。
Imports C1.Xaml.Document Imports Windows.Storage
using C1.Xaml.Document; using Windows.Storage;
Dim pds As New C1PdfDocumentSource() Dim sf As StorageFile
C1PdfDocumentSource pds = new C1PdfDocumentSource(); StorageFile sf;
Dim fileName As String = Nothing sf = Await StorageFile.GetFileFromApplicationUriAsync(New Uri _ ("ms-appx:///DefaultDocument.pdf")) Await pds.LoadFromFileAsync(sf) fileName = Path.GetFileName(sf.Name)
string fileName = null; sf = await StorageFile.GetFileFromApplicationUriAsync( new Uri("ms-appx:///DefaultDocument.pdf")); await pds.LoadFromFileAsync(sf); fileName = Path.GetFileName(sf.Name);
viewer.DocumentSource = pds
viewer.DocumentSource = pds;