IPXV_SearchPtr Interface

From PDF XChange PDF SDK
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 6: Line 6:
  
 
This object holds the path to the object that is being searched for. This is an array of [[PXV:PXV_SearchPtrChunk|PXV_SearchPtrChunk]] structures, where each successive structure (from left to right) defines the "coordinate" of the deeper search level, relative to the preceding array element.
 
This object holds the path to the object that is being searched for. This is an array of [[PXV:PXV_SearchPtrChunk|PXV_SearchPtrChunk]] structures, where each successive structure (from left to right) defines the "coordinate" of the deeper search level, relative to the preceding array element.
 +
 +
<span style="color:red;">
 +
'''WARNING:''' You can '''NOT''' hold and use the IPXV_SearchPtr objects for further usage '''OUTSIDE''' of the Callback's code (IPXV_SearchCallback::OnStartPtr/IPXV_SearchCallback::OnStoptPtr/IPXV_SearchCallback::OnNewEntry), because these objects can be repeatedly used by the operations for other contexts.
 +
</span>
 +
 +
'''Example 1:'''<br />
 +
If we are searching through the '''''document's pages''''' then these structure arrays will be passed through the Callback's methods (IPXV_SearchCallback::OnStartPtr/IPXV_SearchCallback::OnStoptPtr, IPXV_SearchEntryItem::get_Ptr):
 +
 +
{PXV_SearchPtrChunk_Document, <docID>}, {PXV_SearchPtrChunk_Page, <pageIndex>} ...
 +
 +
'''''<docID>''''' - number that identifies the document and is used in the [[PXV:IPXV_SearchPtr_Doc|Doc]] property. It is valid ONLY in the context of the Callbacks' methods and should not be used outside of them.
 +
 +
 +
'''Example 2:'''<br />
 +
If we are searching through the '''''annotations''''' then these structure arrays will be passed through the Callback's methods:
 +
 +
{PXV_SearchPtrChunk_Document, <docID>}, {PXV_SearchPtrChunk_Page, <pageIndex>}, {PXV_SearchPtrChunk_Annotation, <annotIndexOnThePage>}
 +
 +
 +
'''Example 3:'''<br />
 +
If we are searching through the '''''bookmarks''''' then these structure arrays will be passed through the Callback's methods:
 +
 +
{PXV_SearchPtrChunk_Document, <docID>}, {PXV_SearchPtrChunk_Bookmark, <PdfObjNumber>}
 +
 +
'''''<PdfObjNumber>''''' - number of the PDF Object (here it is an number of the PDF Object of the [[PXV:IPXC_Bookmark|IPXC_Bookmark]]. If you will need to find the [[PXV:IPXC_Bookmark|IPXC_Bookmark]] that corresponds to the given PDF Object you will need to run through the Bookmarks' Tree (get the [[PXV:IPXC_Document_BookmarkRoot|root bookmark]] and run through it's children) and compare the <PdfObjNumber> with the [[PXV:IPXS_PDFVariant_ObjectNumber|bookm.PDFObject.ObjectNumber]].
 +
 +
 +
'''Example 4:'''<br />
 +
If we are searching through the '''''attachments''''', including depth (that you can set by using the Op.Params["MaxEmbeddDepth"] option of the operation), then these structure arrays will be passed through the Callback's methods:
 +
 +
{PXV_SearchPtrChunk_Document, <docID>},
 +
:{PXV_SearchPtrChunk_Attachment, <attachmentID>},
 +
::{PXV_SearchPtrChunk_Document, <docID2>},
 +
:::{PXV_SearchPtrChunk_Page, <pageIndex>}
 +
 +
- now we are on the attachment's page...
 +
 +
{PXV_SearchPtrChunk_Document, <docID>},
 +
:{PXV_SearchPtrChunk_Attachment, <attachmentID>},
 +
::{PXV_SearchPtrChunk_Document, <docID2>},
 +
:::{PXV_SearchPtrChunk_Boookmark, <docID2::PdfObjNumber>}
 +
 +
- now we are on the attachment's bookmark...
 +
 +
By using the <attachmentID> with the [[PXV:IPXV_SearchPtr_AttachPtr|AttachPtr]] property, we can get the information about the attachment.
 +
 +
 +
'''Example 4.1:'''<br />
 +
{PXV_SearchPtrChunk_Document, <docID>},
 +
:{PXV_SearchPtrChunk_Attachment, <attachmentID>},
 +
::{PXV_SearchPtrChunk_Document, <docID2>},
 +
:::{PXV_SearchPtrChunk_Attachment, <attachmentID2>}
 +
::::{PXV_SearchPtrChunk_Document, <docID3>},
 +
:::::{PXV_SearchPtrChunk_Page, <pageIndex>}
 +
 +
- now we are on the page that is inside of the attachment that is inside of the attachment of some document.
 +
 +
 +
'''Example 5:'''<br />
 +
Searching in the '''document's info fields''':
 +
{PXV_SearchPtrChunk_Document, <docID>}, {PXV_SearchPtrChunk_DocInfo, <strID>}
 +
 +
'''''<strID>''''' - identifier of some string - tag/key that represents an identifier/mane of the correspondent info field. You can get the string from the <strID> by using the [[PXV:IPXV_SearchPtr_Str|Str]] property.
 +
 +
 +
'''Note:'''<br />
 +
In some cases the Search Operation in place of the object's identifier will put the -1 in the PXV_SearchPtrChunk.nValue. In this cases you will have the possibility to look into main search stages:
 +
 +
OnStartPtr/OnStopPtr(<..., {PXV_SearchPtrChunk_Bookmark, -1}>) - operation begins/ends searching through the bookmarks
 +
 +
OnStartPtr/OnStopPtr(<..., {PXV_SearchPtrChunk_Page, -1}>) - operation begins/ends searching through the pages
 +
 +
OnStartPtr/OnStopPtr(<..., {PXV_SearchPtrChunk_DocInfo, -1}>) - operation begins/ends searching through the document's info
 +
 +
OnStartPtr/OnStopPtr(<..., {PXV_SearchPtrChunk_Attachments, -1}>) - operation begins/ends searching through the attachments
  
 
== Methods ==
 
== Methods ==

Latest revision as of 06:54, 20 January 2017


This object holds the path to the object that is being searched for. This is an array of PXV_SearchPtrChunk structures, where each successive structure (from left to right) defines the "coordinate" of the deeper search level, relative to the preceding array element.

WARNING: You can NOT hold and use the IPXV_SearchPtr objects for further usage OUTSIDE of the Callback's code (IPXV_SearchCallback::OnStartPtr/IPXV_SearchCallback::OnStoptPtr/IPXV_SearchCallback::OnNewEntry), because these objects can be repeatedly used by the operations for other contexts.

Example 1:
If we are searching through the document's pages then these structure arrays will be passed through the Callback's methods (IPXV_SearchCallback::OnStartPtr/IPXV_SearchCallback::OnStoptPtr, IPXV_SearchEntryItem::get_Ptr):

{PXV_SearchPtrChunk_Document, <docID>}, {PXV_SearchPtrChunk_Page, <pageIndex>} ...

<docID> - number that identifies the document and is used in the Doc property. It is valid ONLY in the context of the Callbacks' methods and should not be used outside of them.


Example 2:
If we are searching through the annotations then these structure arrays will be passed through the Callback's methods:

{PXV_SearchPtrChunk_Document, <docID>}, {PXV_SearchPtrChunk_Page, <pageIndex>}, {PXV_SearchPtrChunk_Annotation, <annotIndexOnThePage>}


Example 3:
If we are searching through the bookmarks then these structure arrays will be passed through the Callback's methods:

{PXV_SearchPtrChunk_Document, <docID>}, {PXV_SearchPtrChunk_Bookmark, <PdfObjNumber>}

<PdfObjNumber> - number of the PDF Object (here it is an number of the PDF Object of the IPXC_Bookmark. If you will need to find the IPXC_Bookmark that corresponds to the given PDF Object you will need to run through the Bookmarks' Tree (get the root bookmark and run through it's children) and compare the <PdfObjNumber> with the bookm.PDFObject.ObjectNumber.


Example 4:
If we are searching through the attachments, including depth (that you can set by using the Op.Params["MaxEmbeddDepth"] option of the operation), then these structure arrays will be passed through the Callback's methods:

{PXV_SearchPtrChunk_Document, <docID>},

{PXV_SearchPtrChunk_Attachment, <attachmentID>},
{PXV_SearchPtrChunk_Document, <docID2>},
{PXV_SearchPtrChunk_Page, <pageIndex>}

- now we are on the attachment's page...

{PXV_SearchPtrChunk_Document, <docID>},

{PXV_SearchPtrChunk_Attachment, <attachmentID>},
{PXV_SearchPtrChunk_Document, <docID2>},
{PXV_SearchPtrChunk_Boookmark, <docID2::PdfObjNumber>}

- now we are on the attachment's bookmark...

By using the <attachmentID> with the AttachPtr property, we can get the information about the attachment.


Example 4.1:
{PXV_SearchPtrChunk_Document, <docID>},

{PXV_SearchPtrChunk_Attachment, <attachmentID>},
{PXV_SearchPtrChunk_Document, <docID2>},
{PXV_SearchPtrChunk_Attachment, <attachmentID2>}
{PXV_SearchPtrChunk_Document, <docID3>},
{PXV_SearchPtrChunk_Page, <pageIndex>}

- now we are on the page that is inside of the attachment that is inside of the attachment of some document.


Example 5:
Searching in the document's info fields: {PXV_SearchPtrChunk_Document, <docID>}, {PXV_SearchPtrChunk_DocInfo, <strID>}

<strID> - identifier of some string - tag/key that represents an identifier/mane of the correspondent info field. You can get the string from the <strID> by using the Str property.


Note:
In some cases the Search Operation in place of the object's identifier will put the -1 in the PXV_SearchPtrChunk.nValue. In this cases you will have the possibility to look into main search stages:

OnStartPtr/OnStopPtr(<..., {PXV_SearchPtrChunk_Bookmark, -1}>) - operation begins/ends searching through the bookmarks

OnStartPtr/OnStopPtr(<..., {PXV_SearchPtrChunk_Page, -1}>) - operation begins/ends searching through the pages

OnStartPtr/OnStopPtr(<..., {PXV_SearchPtrChunk_DocInfo, -1}>) - operation begins/ends searching through the document's info

OnStartPtr/OnStopPtr(<..., {PXV_SearchPtrChunk_Attachments, -1}>) - operation begins/ends searching through the attachments

Methods

IsEqual

Properties

AttachPtr Doc Item Str
Count

See Also

IPXV_SearchCallback::OnStartPtr, IPXV_SearchCallback::OnStopPtr, IPXV_SearchEntryItem::Ptr