public override void ViewDidLoad() { base.ViewDidLoad (); string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); string localFilename = "text.docx"; string localPath = Path.Combine(documentsPath, localFilename); this.previewItems = new List<PreviewItem>() { new PreviewItem("PDF", NSUrl.FromFilename("docs/pdfdoc.pdf")), new PreviewItem("DOC", NSUrl.FromFilename(dokumAdres)), new PreviewItem("DOCX", NSUrl.FromFilename(localPath)), new PreviewItem("XLSX", NSUrl.FromFilename("docs/spreadsheet.xlsx")) }; this.previewController = new QLPreviewController(); this.previewController.DataSource = new PreviewDataSource(this.previewItems); this.buttonPreviewDocs.TouchUpInside += delegate { this.PresentModalViewController(this.previewController, true); }; }
public async Task SaveTextAsync(string filename, string contentType, MemoryStream s) { string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); string filePath = Path.Combine(path, filename); try { FileStream fileStream = File.Open(filePath, FileMode.Create); s.Position = 0; s.CopyTo(fileStream); fileStream.Flush(); fileStream.Close(); } catch (Exception e) { } UIViewController currentController = UIApplication.SharedApplication.KeyWindow.RootViewController; while (currentController.PresentedViewController != null) { currentController = currentController.PresentedViewController; } UIView currentView = currentController.View; QLPreviewController qlPreview = new QLPreviewController(); QLPreviewItem item = new QLPreviewItemBundle(filename, filePath); qlPreview.DataSource = new PreviewControllerDS(item); currentController.PresentViewController(qlPreview, true, null); }
public override void ViewDidLoad() { base.ViewDidLoad(); string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); string localFilename = "text.docx"; string localPath = Path.Combine(documentsPath, localFilename); this.previewItems = new List <PreviewItem>() { new PreviewItem("PDF", NSUrl.FromFilename("docs/pdfdoc.pdf")), new PreviewItem("DOC", NSUrl.FromFilename(dokumAdres)), new PreviewItem("DOCX", NSUrl.FromFilename(localPath)), new PreviewItem("XLSX", NSUrl.FromFilename("docs/spreadsheet.xlsx")) }; this.previewController = new QLPreviewController(); this.previewController.DataSource = new PreviewDataSource(this.previewItems); this.buttonPreviewDocs.TouchUpInside += delegate { this.PresentModalViewController(this.previewController, true); }; }
public async Task ExportPDF(PDF Exporter, BuilderContext context) { var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); var tmp = Path.Combine(documents, "..", "tmp"); var f = Path.Combine(tmp, context.Player.Name + ".pdf"); int i = 0; while (File.Exists(f)) { try { File.Delete(f); } catch (Exception) { f = Path.Combine(tmp, context.Player.Name + "-" + (++i) + ".pdf"); } } using (fs = System.IO.File.OpenWrite(f)) { //PDF p = await Load(await PCLSourceManager.Data.GetFileAsync(Exporter).ConfigureAwait(false)).ConfigureAwait(false); fs.SetLength(0); await Exporter.Export(context, this).ConfigureAwait(false); } var fileinfo = new FileInfo(f); Device.BeginInvokeOnMainThread(() => { var previewController = new QLPreviewController { DataSource = new PreviewControllerDataSource(fileinfo.FullName, context.Player.Name + ".pdf") }; GetVisibleViewController().PresentViewController((UIViewController)previewController, true, (Action)null); }); }
public void TriggerPreview (string path) { QLPreviewController previewController = new QLPreviewController (); previewController.DataSource = new MyPreviewDataSource (path); UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(previewController,true, null); }
public string OpenLocalFile(string filePath) { string retval = ""; Device.BeginInvokeOnMainThread(() => { try { bool Exists = new FileInfo(filePath).Exists; Log.Information("Opening downloaded pdf (exists={0}) at {1} ", Exists, filePath); if (Exists) { string name = Path.GetFileName(filePath); QLPreviewItemFileSystem prevItem = new QLPreviewItemFileSystem(name, filePath); UIApplication.SharedApplication.InvokeOnMainThread(() => { QLPreviewController qlpreview = new QLPreviewController(); QLPreviewController previewController = new QLPreviewController(); previewController.DataSource = new PreviewControllerDS(prevItem); UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController( previewController, true, null); }); } else { retval = "File is inaccessible or did not complete downloading"; } } catch (Exception ex) { retval = "Error " + ex.Message; } }); return(retval); }
private void ShowFileSavedInPreviewController(AttachmentFile fileAtt) { QLPreviewController quickLookController = new QLPreviewController(); quickLookController.DataSource = new PreviewControllerDataSource(fileAtt.FileName); NavigationController.PushViewController(quickLookController, true); }
public static void Save(string filename, String contentType, MemoryStream stream) { string exception = string.Empty; string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal); string filePath = Path.Combine(path, filename); try { FileStream fileStream = File.Open(filePath, FileMode.Create); stream.Position = 0; stream.CopyTo(fileStream); fileStream.Flush(); fileStream.Close(); } catch (Exception e) { exception = e.ToString(); } if (exception != string.Empty) { return; } UIViewController currentController = UIApplication.SharedApplication.KeyWindow.RootViewController; while (currentController.PresentedViewController != null) { currentController = currentController.PresentedViewController; } UIView currentView = currentController.View; QLPreviewController qlPreview = new QLPreviewController(); QLPreviewItem item = new QLPreviewItemBundle(filename, filePath); qlPreview.DataSource = new PreviewControllerDS(item); currentController.PresentViewController((UIViewController)qlPreview, true, (Action)null); }
public async void ShowPDFForSigning() { var currentFilePath = "Salesinvoice.pdf"; QLPreviewItemBundle prevItem = new QLPreviewItemBundle ("Salesinvoice.pdf", currentFilePath); QLPreviewController previewController = new QLPreviewController (); previewController.DataSource = new PreviewControllerDS (prevItem); NavigationController.PushViewController (previewController, true); //this adds a button to the QLPreviewController, but it has to wait until after it's been loaded //I'm not sure if there's a better way to do this. await System.Threading.Tasks.Task.Run( () => { System.Threading.Thread.Sleep( 500 ); for (int i = 0; i < 10; i++) { System.Threading.Thread.Sleep( 500 ); InvokeOnMainThread( () => { if (previewController.NavigationItem.RightBarButtonItems.Length == 1) { var signButton = new UIBarButtonItem( UIBarButtonSystemItem.Compose, (o, e ) => { SignPDF(); } ); previewController.NavigationItem.RightBarButtonItems = new UIBarButtonItem[] { signButton, previewController.NavigationItem.RightBarButtonItems[0] }; } } ); } } ); }
public void Defaults() { using (QLPreviewController pc = new QLPreviewController()) { Assert.Null(pc.CurrentPreviewItem, "CurrentPreviewItem"); nint index = 0; #if !__MACCATALYST__ if (TestRuntime.CheckSystemVersion(ApplePlatform.iOS, 10, 0)) { index = nint.MaxValue; } else if (TestRuntime.CheckSystemVersion(ApplePlatform.iOS, 7, 1)) { index = -1; } #endif Assert.That(pc.CurrentPreviewItemIndex, Is.EqualTo(index), "CurrentPreviewItemIndex"); Assert.Null(pc.Delegate, "Delegate"); Assert.Null(pc.WeakDelegate, "WeakDelegate"); Assert.Null(pc.DataSource, "DataSource"); Assert.Null(pc.WeakDataSource, "WeakDataSource"); pc.RefreshCurrentPreviewItem(); pc.ReloadData(); } }
private async void DownloadAndShowInvoiceAsync(object sender, EventArgs e) { this.RideDetailViewModel.IsLoadingRide = true; string invoiceFilePath = null; try { invoiceFilePath = await InvoiceService.DownloadInvoiceAsync( this.RideDetailViewModel.Ride.EmployeeId, this); } catch (Exception) { } finally { this.RideDetailViewModel.IsLoadingRide = false; } if (invoiceFilePath == null) { return; } var pdfPreviewController = new QLPreviewController { DataSource = new PDFPreviewControllerDataSource(invoiceFilePath, Path.GetFileName(invoiceFilePath)) }; await this.NavigationController.PresentViewControllerAsync(pdfPreviewController, true); }
public void Defaults() { using (QLPreviewController pc = new QLPreviewController()) { Assert.Null(pc.CurrentPreviewItem, "CurrentPreviewItem"); var dev = UIDevice.CurrentDevice; nint index = 0; if (dev.CheckSystemVersion(10, 0)) { index = nint.MaxValue; } else if (dev.CheckSystemVersion(7, 1)) { index = -1; } Assert.That(pc.CurrentPreviewItemIndex, Is.EqualTo(index), "CurrentPreviewItemIndex"); Assert.Null(pc.Delegate, "Delegate"); Assert.Null(pc.WeakDelegate, "WeakDelegate"); Assert.Null(pc.DataSource, "DataSource"); Assert.Null(pc.WeakDataSource, "WeakDataSource"); pc.RefreshCurrentPreviewItem(); pc.ReloadData(); } }
private void ShowFileSavedInPreviewController(Document doc) { QLPreviewController quickLookController = new QLPreviewController(); quickLookController.DataSource = new PreviewControllerDataSource(doc.Name); NavigationController.PushViewController(quickLookController, true); }
public Task View(Stream stream, string filename) { string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal); string filePath = Path.Combine(path, filename); using (FileStream fileStream = File.Open(filePath, FileMode.Create)) { stream.Seek(0, SeekOrigin.Begin); stream.CopyTo(fileStream); } UIViewController currentController = UIApplication.SharedApplication.KeyWindow.RootViewController; while (currentController.PresentedViewController != null) { currentController = currentController.PresentedViewController; } UIView currentView = currentController.View; QLPreviewController qlPreview = new QLPreviewController(); QLPreviewItem item = new QLPreviewItemBundle(filename, filePath); qlPreview.DataSource = new PreviewControllerDS(item); currentController.PresentViewController(qlPreview, true, null); return(Task.CompletedTask); }
public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { if (indexPath.Section == 0) { var previewController = UIDocumentInteractionController.FromUrl( NSUrl.FromFilename(source.Documents[indexPath.Row])); previewController.Delegate = new MyInteractionDelegate(this); previewController.PresentPreview(true); // You can present other options for the file instead of a preview // //previewController.PresentOptionsMenu(TableView.Frame, TableView, true); //previewController.PresentOpenInMenu(TableView.Frame, TableView, true); } else { var previewController = new QLPreviewController(); previewController.DataSource = new QuickLookSource(source.Documents); previewController.CurrentPreviewItemIndex = indexPath.Row; NavigationController.PushViewController(previewController, true); // You can present modally instead // // PresentViewController(previewController, true, null); } }
public override IQLPreviewItem GetPreviewItem(QLPreviewController controller, nint index) { string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache); NSUrl url = NSUrl.FromFilename(Path.Combine(documentsPath, fileName)); return(new PDFViewItem(fileName, url)); }
public async Task SaveTextAsync(string filename,string contentType, MemoryStream s) { string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); string filePath = Path.Combine(path,filename); try { FileStream fileStream = File.Open(filePath, FileMode.Create); s.Position=0; s.CopyTo(fileStream); fileStream.Flush(); fileStream.Close(); } catch (Exception e) { } UIViewController currentController = UIApplication.SharedApplication.KeyWindow.RootViewController; while (currentController.PresentedViewController != null) currentController = currentController.PresentedViewController; UIView currentView = currentController.View; QLPreviewController qlPreview = new QLPreviewController(); QLPreviewItem item= new QLPreviewItemBundle(filename,filePath); qlPreview.DataSource = new PreviewControllerDS(item); currentController.PresentViewController (qlPreview, true, null); }
public override IQLPreviewItem GetPreviewItem(QLPreviewController controller, nint index) { string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.InternetCache); NSUrl url = NSUrl.FromFilename (Path.Combine (documentsPath, fileName)); return new PDFViewItem (fileName, url); }
public void Open(string title, params string[] paths) { // Get path var path = localFileSystemService.GetLocalPath(paths); // Get filename var fileName = Path.GetFileName(path); UIViewController currentController = UIApplication.SharedApplication.KeyWindow.RootViewController; while (currentController.PresentedViewController != null) { currentController = currentController.PresentedViewController; } UIView currentView = currentController.View; QLPreviewController qlPreview = new QLPreviewController(); QLPreviewItem item = new QLPreviewItemBundle(fileName, path); qlPreview.DataSource = new PreviewControllerDS(item); currentController.PresentViewController(qlPreview, true, null); }
public void Save(string filename, string contentType, MemoryStream stream) { string exception = string.Empty; string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal); string filePath = Path.Combine(path, filename); try { FileStream fileStream = File.Open(filePath, FileMode.Create); stream.Position = 0; stream.CopyTo(fileStream); fileStream.Flush(); fileStream.Close(); } catch (Exception e) { exception = e.ToString(); } if (contentType == "application/html" || exception != string.Empty) return; UIViewController currentController = UIApplication.SharedApplication.KeyWindow.RootViewController; while (currentController.PresentedViewController != null) currentController = currentController.PresentedViewController; UIView currentView = currentController.View; QLPreviewController qlPreview = new QLPreviewController(); QLPreviewItem item = new QLPreviewItemBundle(filename, filePath); qlPreview.DataSource = new PreviewControllerDS(item); //UIViewController uiView = currentView as UIViewController; currentController.PresentViewController((UIViewController)qlPreview, true, (Action)null); }
public void ShowDocumentFile(string filepath, string mimeType) { var filename = filepath; string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); // Documents folder string libraryPath = Path.Combine(documentsPath, "..", "Library"); // Library folder var path = Path.Combine(libraryPath, filename); // This is where we copy in the prepopulated database Console.WriteLine(path); if (!File.Exists(path)) { File.Copy(filename, path); } var fileinfo = new FileInfo(path); var previewController = new QLPreviewController(); previewController.DataSource = new PreviewControllerDataSource(fileinfo.FullName, fileinfo.Name); UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(previewController, true, null); //UINavigationController controller = FindNavigationController(); //if (controller != null) //{ // controller.PresentViewController((UIViewController)previewController, true, (Action)null); //} }
public void ShowDocumentFile(string name, Stream file, string mimeType) { var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); var tmp = Path.Combine(documents, "..", "tmp"); using (FileStream fs = File.OpenWrite(Path.Combine(tmp, name))) { file.CopyTo(fs); } var fileinfo = new FileInfo(Path.Combine(tmp, name)); Device.BeginInvokeOnMainThread(() => { var previewController = new QLPreviewController { DataSource = new PreviewControllerDataSource(fileinfo.FullName, fileinfo.Name) }; UINavigationController controller = FindNavigationController(); if (controller != null) { controller.PresentViewController((UIViewController)previewController, true, (Action)null); } }); }
public void showPhoto(string AttachmentName, byte[] AttachmentBytes) { var FileName = AttachmentName; string dirPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); var filename = Path.Combine(dirPath, FileName); FileInfo fi = new FileInfo(filename); if (!NSFileManager.DefaultManager.FileExists(filename)) { Stream stream = new MemoryStream(AttachmentBytes); NSData imgData = NSData.FromStream(stream); NSError err; imgData.Save(filename, false, out err); } Xamarin.Forms.Device.BeginInvokeOnMainThread(() => { QLPreviewController previewController = new QLPreviewController(); previewController.DataSource = new PDFPreviewControllerDataSource(fi.FullName, fi.Name); UINavigationController controller = FindNavigationController(); if (controller != null) { controller.PresentViewController(previewController, true, null); } }); }
public async Task ExportPDF(string Exporter, BuilderContext context) { var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); var tmp = Path.Combine(documents, "..", "tmp"); using (fs = System.IO.File.OpenWrite(Path.Combine(tmp, context.Player.Name + ".pdf"))) { PDF p = await Load(await PCLSourceManager.Data.GetFileAsync(Exporter).ConfigureAwait(false)).ConfigureAwait(false); await p.Export(context, this).ConfigureAwait(false); } var fileinfo = new FileInfo(Path.Combine(tmp, context.Player.Name + ".pdf")); Device.BeginInvokeOnMainThread(() => { var previewController = new QLPreviewController { DataSource = new PreviewControllerDataSource(fileinfo.FullName, fileinfo.Name) }; UINavigationController controller = FindNavigationController(); if (controller != null) { controller.PresentViewController((UIViewController)previewController, true, (Action)null); } }); }
public async Task SaveAndView(string fileName, MemoryStream stream, string contentType = "application / pdf") { await Task.Yield(); //Get the root path in iOS device. string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal); string filePath = Path.Combine(path, fileName); //Create a file and write the stream into it. FileStream fileStream = File.Open(filePath, FileMode.Create); stream.Position = 0; stream.CopyTo(fileStream); fileStream.Flush(); fileStream.Close(); //Invoke the saved document for viewing UIViewController currentController = UIApplication.SharedApplication.KeyWindow.RootViewController; while (currentController.PresentedViewController != null) { currentController = currentController.PresentedViewController; } UIView currentView = currentController.View; QLPreviewController qlPreview = new QLPreviewController(); QLPreviewItem item = new QLPreviewItemBundle(fileName, filePath); qlPreview.DataSource = new PreviewControllerDS(item); currentController.PresentViewController(qlPreview, true, null); }
public void TriggerPreview(string path) { QLPreviewController previewController = new QLPreviewController(); previewController.DataSource = new MyPreviewDataSource(path); UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(previewController, true, null); }
public override IQLPreviewItem GetPreviewItem(QLPreviewController controller, nint index) { var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); var library = Path.Combine(documents, this.fileName); NSUrl url = NSUrl.FromFilename(library); return(new QlItemPreview("", url)); }
public static void DisplayPdf(string path, UINavigationController parentController) { QLPreviewController previewController = new QLPreviewController(); previewController.DataSource = new PDFPreviewControllerDataSource(path, Path.GetFileName(path)); parentController.PushViewController(previewController, true); }
public override void ViewDidAppear(bool animated) { base.ViewDidAppear (animated); QLPreviewController previewController = new QLPreviewController(); previewController.DataSource = new PDFViewDataSource(filePdf); this.PresentViewController(previewController, true, null); }
void HandleClicked(object sender, UIButtonEventArgs e) { if (e.ButtonIndex == 1) { QLPreviewController previewController = new QLPreviewController(); previewController.DataSource = new PDFViewDataSource(pdfFileName); this.PresentViewController(previewController, true, null); } }
public override IQLPreviewItem GetPreviewItem (QLPreviewController controller, nint index) { // This does not work: //var url = NSUrl.FromFilename("pdf.pdf"); // This does: var url = NSUrl.FromFilename(NSBundle.MainBundle.PathForResource ("pdf.pdf", null)); return new QLItem ("Some PDF", url); }
public override QLPreviewItem GetPreviewItem(QLPreviewController controller, int index) { string fileName = @"example.pdf"; var documents = NSBundle.MainBundle.BundlePath; var library = Path.Combine(documents, fileName); NSUrl url = NSUrl.FromFilename(library); return(new QlItem("Title", url)); }
public override void ViewDidAppear(bool animated) { base.ViewDidAppear(animated); QLPreviewController previewController = new QLPreviewController(); previewController.DataSource = new PDFViewDataSource(filePdf); this.PresentViewController(previewController, true, null); }
public override IQLPreviewItem GetPreviewItem(QLPreviewController controller, nint index) { // This does not work: //var url = NSUrl.FromFilename("pdf.pdf"); // This does: var url = NSUrl.FromFilename(NSBundle.MainBundle.PathForResource("pdf.pdf", null)); return(new QLItem("Some PDF", url)); }
public override IQLPreviewItem GetPreviewItem(QLPreviewController controller, nint index) { int idx = int.Parse(index.ToString()); if (idx < sources.Length) { return(sources.ElementAt(idx)); } return(null); }
private void ShowPdfFromLocalPath(string path) { FileInfo fi = new FileInfo(path); QLPreviewController previewController = new QLPreviewController { DataSource = new ItemPreviewControllerDataSource(fi.FullName, fi.Name) }; UINavigationController controller = FindNavigationController(); controller?.PresentViewController(previewController, true, null); }
public void PlayVideo(string path) { string name = Path.GetFileName(path); Device.BeginInvokeOnMainThread(() => { QLPreviewItemFileSystem prevItem = new QLPreviewItemFileSystem(name, path); QLPreviewController previewController = new QLPreviewController(); previewController.DataSource = new PreviewControllerDS(prevItem); UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(previewController, true, null); }); }
public void ShowDocumentFile(string filepath, string mimeType) { var fileinfo = new FileInfo(filepath); var previewController = new QLPreviewController { DataSource = new PreviewControllerDataSource(fileinfo.FullName, fileinfo.Name) }; var controller = FindNavigationController(); controller?.PresentViewController(previewController, true, null); }
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions) { // Override point for customization after application launch. // If not required for your application you can safely delete this method this.Window = new UIWindow(UIScreen.MainScreen.Bounds); this.Window.MakeKeyAndVisible(); var preview = new QLPreviewController (); preview.DataSource = new PreviewDataSource (); preview.Delegate = new PreviewDelegate(); // You can present the controller directly... //this.Window.RootViewController = new UINavigationController(preview); // ...or add its view to your own view hierarchy. this.Window.RootViewController = new UIViewController(); this.Window.RootViewController.View.AddSubview(preview.View); return true; }
public override void ViewDidLoad() { base.ViewDidLoad (); this.previewItems = new List<PreviewItem>() { new PreviewItem("PDF", NSUrl.FromFilename("docs/pdfdoc.pdf")), new PreviewItem("DOCX", NSUrl.FromFilename("docs/text.docx")), new PreviewItem("XLSX", NSUrl.FromFilename("docs/spreadsheet.xlsx")), new PreviewItem("DOC", NSUrl.FromFilename(DokAdresi)) }; this.previewController = new QLPreviewController(); this.previewController.DataSource = new PreviewDataSource(this.previewItems); this.showDoc.TouchUpInside += delegate { this.PresentModalViewController(this.previewController, true); }; }
public override QLPreviewItem GetPreviewItem (QLPreviewController controller, int index) { return _items [index]; }
public override int PreviewItemCount (QLPreviewController controller) { return _items.Count; }
public override QLPreviewItem GetPreviewItem(QLPreviewController controller, int index) { return new PDFItem(filename, url); }
void SignatureWasCompleted(byte[] signatureImage, string name) { NavigationController.PopViewControllerAnimated( false ); var dirPath = Path.Combine (System.Environment.GetFolderPath (Environment.SpecialFolder.Personal), "SignedPDF"); if (!Directory.Exists (dirPath)) Directory.CreateDirectory (dirPath); string fileName = string.Format("result-{0}.pdf", Guid.NewGuid().ToString()); var signedFilePath = Path.Combine (dirPath, fileName); if (File.Exists(signedFilePath)) File.Delete(signedFilePath); using (Stream inputPdfStream = new FileStream("Salesinvoice.pdf", FileMode.Open, FileAccess.Read, FileShare.Read)) using (Stream outputPdfStream = new FileStream(signedFilePath, FileMode.Create, FileAccess.Write, FileShare.None)) { var reader = new PdfReader(inputPdfStream); var stamper = new PdfStamper(reader, outputPdfStream); var pdfContentByte = stamper.GetOverContent(1); iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(signatureImage); image.SetAbsolutePosition(90, 90); var width = 200F; image.ScaleToFit(width, (float)(width * (200.0 / 480.0))); pdfContentByte.AddImage(image); stamper.Close(); } //Display signature after saved QLPreviewItemFileSystem prevItem = new QLPreviewItemFileSystem (fileName, signedFilePath); QLPreviewController previewController = new QLPreviewController (); previewController.DataSource = new PreviewControllerDS (prevItem); NavigationController.SetNavigationBarHidden( false, true ); NavigationController.PushViewController (previewController, true); }
public override IQLPreviewItem GetPreviewItem(QLPreviewController controller, nint index) { return _item; }
public override nint PreviewItemCount(QLPreviewController controller) { return 1; }
public DocumentController (UINavigationController navigation) { _navigation = navigation; pc = new QLPreviewController (); pc.ModalInPopover = false; }