[C# Syntax] using Viscomsoft.UWP.PDFViewerSDK; DocumentFactory factory = new DocumentFactory();
IDocument doc = factory.CreateDocument(file.Name);
bool opened = await doc.OpenAsync(file);
if (opened) { if (doc.RequiresPassword) {
string strPassword = await InputTextDialogAsync("Password");
bool passwordApplied = await doc.ApplyPasswordAsync(strPassword); if (!passwordApplied) { MessageDialog messageDialog = new MessageDialog("Password is incorrect", "Open File"); await messageDialog.ShowAsync(); return; }
}
}
_pdfDisplayManager = new PDFDisplayManager();
_pdfDisplayManager.Width = (int)Window.Current.Bounds.Width;
_pdfDisplayManager.Height = (int)Window.Current.Bounds.Height;
_pdfDisplayManager.Document = doc;
_pdfDisplayManager.GotoPage(1);
uiViewPanel.Child = createScrollViewControl();
|