Welcome Guest! To enable all features, please Login or Register.



Last Go to last post Unread Go to first unread post
#1 Posted : Monday, August 24, 2015 7:39:46 AM(UTC)


Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

I am using Visual Studio 2013, ASP.NET 4.5 MVC 5, LEADTOOLS v19. The steps listed assumes you already have our SDK installed and the document service set up properly.

I added a simple version of our document viewer to an MVC project. For my project, I have added annotations and the ability to enter a URL for another document.

But if you want to start from scratch you can do the following.
1.Create a default Asp.Net MVC app using Visual Studio
2.Create a folder at root, I called mine ‘libs’, add our mentioned Javascript libraries to the folder you created. I also created a separate JS file called App.js instead of doing an inline script.
3. Create a new view in home I called mine "DocumentViewer".
4.Go to your HomeController and add a ActionResult for this view( public ActionResult DocumentViewer(){ return View(); })
5. Following the example at: https://www.leadtools.co...s.ui.documentviewer.html
Add the html to the DocumentViewer.cshtml view you just made. Leave out any html, head, or body tags since they are already in the layout shared view.
6. Add a "@section scripts { }" put all of your scripts here and prepend their path with a '~' e.g()
7. Take the css and put it in a separate file in the Content folder.
8. Go to your BundleConfig.cs and add it to the stylebundle include so it will be included with the rest of the css.
9. Go to project properties -> web -> Servers section and set it to IIS so that we don't have any CORS issues with our document service.
10. Lastly, go to the shared view _Layout.cshtml and add <li>@Html.ActionLink("DocumentViewer", "DocumentViewer", "Home")</li> to the navbar so that you have a link to your document viewer page.

Now you should be able to build, run, and play with our document viewer!
File Attachment(s):
SimpleDocumentViewerMVC.zip (729kb) downloaded 188 time(s).

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, December 15, 2015 12:33:18 PM(UTC)


Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Attached is the updated project using the new document viewer asp.net MVC instead of the REST services.

To use the attached:
1. Add this project to the DocumentViewer in C:\LEADTOOLS 19\Examples\JS\DocumentViewer
2. Go to properties for WebApp, configure it to use local IIS, create the virtual directory.
3. Go to properties for ClientSide and configure it to use IIS, create virtual directory.
4. Set ClientSide as startup project, and run it.

If you want to use IIS express, you can take the ClientSide code and put it in the WebApp project in place of what is in the App folder.

The modifications from a standard ASP.NET MVC project made were:
Add libs folder, add leadtools libraries into it
Add css into Content folder
Modify BundleConfig to include the added css
Remove excess page views
Modify shared view to remove the links to the excess views
and put document viewer html into index.html

NOTE: All of the relevant DocumentViewer code is in libs/App.js
File Attachment(s):
ClientSide.zip (722kb) downloaded 165 time(s).
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2021, Yet Another Forum.NET
This page was generated in 0.123 seconds.