Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created October 2, 2023 13:36
Show Gist options
  • Save bjoerntx/a3434485b430a3f1c4ca1bcc5f330092 to your computer and use it in GitHub Desktop.
Save bjoerntx/a3434485b430a3f1c4ca1bcc5f330092 to your computer and use it in GitHub Desktop.
@using TXTextControl.Web.MVC.DocumentViewer
@using System.Text
<div style="width: 800px; height: 600px;">
@Html.TXTextControl().DocumentViewer(settings => {
settings.DocumentData = Convert.ToBase64String(ViewBag.Document);
settings.Dock = DocumentViewerSettings.DockStyle.Fill;
settings.DocumentLoadSettings.PDFJS.BasePath = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.2.146";
}).Render()
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment