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

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, February 21, 2006 5:29:35 PM(UTC)

tmhai  
tmhai

Groups: Registered
Posts: 11


[li]Hi all,

Does anybody here know how to display annotation toolbar(toolbox) in web page by using javascript?It look like MFC Annotation demo?

And how to view the next page of the multi-page files.Lead tools only view one page of them.

Although I set    RasterIO1.Load(LEADRasterView1.Raster, "C:/5.pdf", 0, 0, -1) to  view all pages but it don't work.

Do anybody here know why? please help me.

I'm in urgent.

all your help will be appreciated.

I attached file for your reference?

 

Thanks and best regards,

 

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 : Thursday, February 23, 2006 5:23:00 AM(UTC)

Ali  
Guest

Groups: Guests
Posts: 3,040

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

-About the first part, please check this post
http://support.leadtools...orums/4455/ShowPost.aspx

you will find the answer.


-All pages are loaded, but to select which one to display, you need to
assign a value to the BitmapListIndex ranging from 0 to (BitmapListCount - 1).


Thanks,
Ali Abo Al-Rob
LEADTOOLS Technical Support

 
#3 Posted : Thursday, February 23, 2006 9:03:02 PM(UTC)

tmhai  
tmhai

Groups: Registered
Posts: 11


Hi Ali Abo Al-Rob,

Thank you very much for your help.

I did it as you guided but It didn't work.

Here is my code from javascript example.

  function LoadImage()
  { 
  RasterIO1.Load(LEADRasterView1.Raster, "C:/readme.pdf", 0, 0, -1); 
  RasterIO1.BitmapListIndex =0;
  RasterIO1.BitmapListIndex =1;
  RasterIO1.BitmapListIndex =2;

 alert(RasterIO1.BitmapListIndex );
  }

My readme.pdf file has 3 pages but it always display the first page?

When i run it, it alert "undefined".I think that it doesn't understand the property of BitmapListIndex or BitmapListCount.

Could you please help me correct this code?

Hope to hear from you soon

Thank and Regards.

TomHais

 

 
#4 Posted : Monday, February 27, 2006 4:16:32 AM(UTC)

Ali  
Guest

Groups: Guests
Posts: 3,040

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

Instead of Raster object use RasterUnk , this object used for scripting languages, so change your code to
RasterIO1.Load(LEADRasterView1.Raster, "c:\\Problem1.pdf", 0, 1, -1);
    LEADRasterView1.RasterUnk.BitmapListIndex = 1;

If you need any further assistance, please feel free to contact me.

Thanks,
Ali Abo Al-Rob
LEADTOOLS Technical Support


 
#5 Posted : Monday, February 27, 2006 10:24:54 PM(UTC)

tmhai  
tmhai

Groups: Registered
Posts: 11


Hi Ali,

Thank you very for your help.

I can load and view multi-page file but I meet another problem.

When I create Annotation on the second page of this file and load it again but it(annotation) always display in the first page.

When I delete annotation in this page and view it again,It isn't deleted.

Can annotation file save multi-page file? And how to load annotation with exact position we create in this file?

My code is here:

//Load file and anntation together

function load()

{

  RasterIO1.Load(LEADRasterView1.Raster, "C:/readme.pdf", 0, 0, -1);
  RasterAnn.AnnUserMode = 1;  var nRet=RasterAnn.AnnLoad("C:/readme.ann",LEADRasterView1.RasterUnk.BitmapListIndex);

}

      function Next()
      {
               LEADRasterView1.RasterUnk.BitmapListIndex=  LEADRasterView1.RasterUnk.BitmapListIndex + 1;
            var nRet=RasterAnn.AnnLoad("C:/readme.ann", LEADRasterView1.RasterUnk.BitmapListIndex);

    }

 

function Save()
{
   var nRet;
   var ANN_USERMODE_DESIGN = 1;
   var ANN_FMT_NATIVE = 0;
   var SAVE_OVERWRITE = 1;
   RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN;

   //Disable errors so that we can trap our own.
   RasterAnn.EnableMethodErrors = false; 
    //Do nothing if there are no annotations. 
     if (RasterAnn.AnnContainer == 0)
         return;
      //Save the all annotations. 
 
      nRet = RasterAnn.AnnSave("c:\\readme.ann", ANN_FMT_NATIVE, false,   SAVE_OVERWRITE, LEADRasterView1.RasterUnk.BitmapListIndex +1); 
   }

When I load multi-page file  by calling fuction load() and click next page by calling function Next().  Then I draw anntation on this page of file and click Next to move to next page.Then I save this file by calling fuction Save().

I load this file again ,click next to view the second page,there are no annotion in it.

I delete some annotation and save it but it isnot deleted.

Please help me to correct above code.

How to save all annotation and load it as it create?

Please give me an example code load multipage file with anotation on it.

Thanks and best regards,

Hai.

 

 
#6 Posted : Wednesday, March 1, 2006 2:56:22 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

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

Hello,

Yes, you can save a Multi-page annotation files. When saving annotations using the AnnSave method, you will need to specify the page number of the annotation page in the result annotation file. In other words, you can handle annotation files such as the Multi-page image files.

For example, to save a multi-page annotation file, when creating annotation objects on the first page from the image, you will need to save them to the first page in the result Ann file, as follows:
+----------------------------+
nRet = RasterAnn.AnnSave("c:\lead\images\tmp.ann", ANN_FMT_NATIVE, False, SAVE_insert,1)
+----------------------------+
Now, if you load the second page from the image, and draw annotation objects on it, you will need the annotations to the second page in the same Ann file as follows:
+----------------------------+
nRet = RasterAnn.AnnSave("c:\lead\images\tmp.ann", ANN_FMT_NATIVE, False, SAVE_insert,2)
+----------------------------+
And so on…

Then, you can load the annotation page that you want from a multi-page annotation file by using the
nRet = RasterAnn.AnnLoad ("c:\lead\images\tmp.ann", 2) ' this code loads the second page in Multi-page annotation file.

Please try the above instructions and let me know what will happen with you.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#7 Posted : Thursday, March 2, 2006 12:26:23 AM(UTC)

tmhai  
tmhai

Groups: Registered
Posts: 11


Hi Maen Badwan,

Thank you very much for your help.You are  a perfect supporter.

I can load annotation in multipage file as you guided but I'm meeting another problem in deleting annotation.

When I create annotation on the first or the second page of the multipage file and save it.Then I load it again,I delete annotation on the first page and save it.
After that ,I move to the second page and see annotation of the first page appear on the second page and annotation of the second page appear on the next page...
But If I delete annotation of the last page ,it's ok because this is the last page which can be moved to the next page.

here is my code:

      nRet = RasterAnn.AnnSave("C:/readme.ann", ANN_FMT_NATIVE, false, SAVE_INSERT, LEADRasterView1.RasterUnk.BitmapListIndex + 1); //save annotation of current page
      LEADRasterView1.RasterUnk.BitmapListIndex = LEADRasterView1.RasterUnk.BitmapListIndex + 1;//move to next page
      var nRet=RasterAnn.AnnLoad("C:/readme.ann", LEADRasterView1.RasterUnk.BitmapListIndex + 1 );//load annotation of current page.

How to save all annotations one time after drawing them on different pages of  the multipage file without saving them on each page?

Because I use web,user can draw annotation a page and move to the next page and draw another annotation on this page .Then they save it.
but only the final page is saved.
Please help me to solve the problem.

I also enclose my code file for your reference.

Your help will be highly appreciated.

 I'm very in urgent and I hope to hear from you soon,

Thanks and best regards,
Hai

 
#8 Posted : Sunday, March 5, 2006 3:24:53 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

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

Hello,

Do you mean that you want to open a page, draw annotations on it, and press next. Then draw a different page, draw annotations, and press next, and then on the last page, save all annotations to a Multipage file?
If yes, you will not be able to do it directly. You will need to save the annotations on the Multipage file when you press the next button. Does this work with you?

However, instead of deleting the Annotation page itself, you may try to delete the annotation objects on it, and keep the annotation page empty. You can delete all the objects on annotation page without deleting the page itself by:
- load the page that you want to delete.
- Select all the annotation objects in the page by calling the RasterAnn.AnnSelectRect method (pass the directions of the image to AnnSelectRect method).
- call the RasterAnn.AnnDestroy function as follows to delete all the selected annotations:
RasterAnn.AnnContainer, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED
- Now, save the same annotation page to the same annotation file using the
nRet = RasterAnn.AnnSave("c:\lead\images\tmp.ann", ANN_FMT_NATIVE, False, SAVE_REPLACE,pagenumber)

Please try the above instructions and let me know what will happen with you.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
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-2019, Yet Another Forum.NET
This page was generated in 0.267 seconds.