Duplicating bookmark?

If you are a C/C++/C# developer and have any questions about using our products from your application here is the place to post them.
Post Reply
beandog
Posts: 33
Joined: Wed Dec 14 2005

Duplicating bookmark?

Post by beandog »

Is there any way to duplicate a bookmark? I tried with the following code:

CString csTitle = bMove.get_Title();
CString csObject = bMove.get_Object();

LPDISPATCH lpNew = NULL;
int iPlace = bNewParent.get_Count();
bNewParent.InsertChild(iPlace, csTitle, csObject, &lpNew);
CacBookmark bNew = lpNew;

But csObject is always blank for the bookmarks when I open a document. Obviously the information about where the bookmark points to is in there somewhere, since you can navigate to it correctly. How do I get at it?



Ben Dilts
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hello,

The csObject is returning an empty string because the bookmark is not pointing an object.

The bookmark will point by default to the object referenced in the ‘Object’ parameter. If ‘Object’ is empty, the bookmark points to the first selected object, if no object is selected, it will point to the top of the current page.

In the code snippet below the child bookmark will point the "acPic" picture object on the page.

.InsertChild(iPlace, cs, "acPic", &lpNew);

Hope this helps?
beandog
Posts: 33
Joined: Wed Dec 14 2005

Post by beandog »

I am not trying to create a bookmark to point at some known object! I have a bookmark, and I want to know what object it points at. Failing that, I want to know what page it is on.

For instance, if I open the developer manual for the PDF Creator in Adobe Acrobat and click on the second bookmark ("Acknowledgements"), the view of the PDF document is moved so that the title "Acknowledgements" is at the very top of the screen (the PDF Creator makes Acknowledgements visible somewhere on the screen). Now, if I open that document in the PDFCreactiveX control and query that bookmark for what object it points at, I get an empty string.

I want to know what an arbitrary bookmark points at.



Ben Dilts
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

I believe that you are getting the empty string because the document you are trying to view is saved in view only mode, and thus the objects names are not stored in the document.

I suggest that you try with a document that you create yourself and save in view and design mode.

Hope this helps.
beandog
Posts: 33
Joined: Wed Dec 14 2005

Post by beandog »

I can of course get this information from a document that I create myself, but our viewer is intended mainly for users to operate on documents that are supplied from another source.

Thanks anyway.



Ben Dilts
Post Reply