LEADTOOLS Support
Document
Document SDK Examples
HOW TO : v18 HTML5 Multipage Annotation Demo
While some posts in this topic are more current, this topic was posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, October 30, 2014 12:20:00 PM(UTC)
Groups: Manager, Tech Support, Administrators
Posts: 218
Was thanked: 12 time(s) in 12 post(s)
The attached HTML5 / JavaScript project shows how to use our Annotation in a multipage environment. Also attached is a modified Leadtools.RESTServices project that adds a method to the Raster.svc to allow annotation burning on the server side so that you can burn and save the entire multipage document and then send it to the client.
This project uses the AttachContainer method of the AnnAutomation to attach a separate container for each page of the document. Here is the documentation link for it:
https://www.leadtools.com/help/leadtools/v18/dh/javascript/aa/leadtools.annotations.automation~leadtools.annotations.automation.annautomation~attachcontainer.html
The flow of this application is:
- Initialize the viewer and annotations
- Load page 1 of the multipage image
- Get the total page count using the Raster.svc Info method
- Create an AnnContainer for each page and store them in an array
- Allow the navigation between the pages by loading the correct page using the Raster.svc Load method with the page number passed
- Attach the correct AnnContainer from the array of all the containers using the AttachContainer method of the AnnAutomation
When saving the document:
- Save each AnnContainer to a multipage XmlString using AnnCodecs.Save method
- Pass the XmlString to the Data.svc SaveXml method and get the path of the Annotation Xml file
- Pass the URL and the Xml path (from last step) to the new Raster.svc Save method
- On the server side, it will load each page of the image url and the xml file and burn them
- The resultant file path is then passed to the client side for download using the Data.svc Download method
To run this project do the following:
- Make sure to have IIS setup on your machine
- Run this exe to setup the REST services - C:\LEADTOOLS
18\Shortcuts\HTML5\01 Document\01 Local Demos\10 Run This First To
Configure Demos and Services - Make sure that the services are setup correctly by Testing them on the
final tab of the utility (if any errors occur, please click the
'Troubleshooting' button - Extract the MultipageAnnotationDemo folder and move it to your 'C:\inetpub\wwwroot\' folder (iis localhost)
- Extract the Leadtools.RESTServices to your 'C:\LEADTOOLS 18\Examples\REST' folder and replace the one already there
- Open the 'Leadtools.RESTServices\Leadtools.RESTServices_AnyCPU_2010.sln' in Visual Studio and rebuild the DLL (it should output to 'C:\LEADTOOLS 18\Examples\REST\RESTServicesHost\Bin')
- Browse to the HTML file -http://localhost/MultipageAnnotationDemo/default.html
- Load any support multipage document and draw annotations on each page, click the 'Save Document' button to save the document + annotations to your machine
Hadi Chami
Developer Support Manager
LEAD Technologies, Inc.
#2
Posted
:
Thursday, December 18, 2014 11:25:44 AM(UTC)
Groups: Manager, Tech Support, Administrators
Posts: 218
Was thanked: 12 time(s) in 12 post(s)
I have updated this project to work with v19 JavaScript and v19 .NET DLL in the REST service.
Follow all the same steps except:
To run this project do the following:
- Make sure to have IIS setup on your machine
- Run this exe to setup the REST services - C:\LEADTOOLS 19\Shortcuts\Annotation\JavaScript\10 Run This First To
Configure Demos and Services
- Make sure that the services are setup correctly by Testing them on the
final tab of the utility (if any errors occur, please click the
'Troubleshooting' button - Extract the MultipageAnnotationDemo folder and move it to your 'C:\inetpub\wwwroot\' folder (iis localhost)
- Extract the Leadtools.RESTServices to your 'C:\LEADTOOLS 19\Examples\REST' folder and replace the one already there
- Open
the 'Leadtools.RESTServices\Leadtools.RESTServices_AnyCPU_2010.sln' in
Visual Studio and rebuild the DLL (it should output to 'C:\LEADTOOLS 19\Examples\REST\RESTServicesHost\Bin')
- Browse to the HTML file -http://localhost/MultipageAnnotationDemo19/default.html
- Load
any support multipage document and draw annotations on each page, click
the 'Save Document' button to save the document + annotations to your
machine
Hadi Chami
Developer Support Manager
LEAD Technologies, Inc.
LEADTOOLS Support
Document
Document SDK Examples
HOW TO : v18 HTML5 Multipage Annotation Demo
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.