PXCV_GetDocumentInfoW

<< Click to Display Table of Contents >>

Navigation:  Functions >

PXCV_GetDocumentInfoW


 

pdf-xchange-editor-simple-sdk_100x100 PXCV_GetDocumentInfoW

 


 

PXCV_GetDocumentInfoW retrieves information from the info dictionary of documents. (The information retrieved is the same as that displayed when files are right-clicked and the Properties option is selected).

 

HRESULT PXCV_GetDocumentInfoW(

PXVDocument Doc,

LPCSTR name,

LPWSTR value,

DWORDvaluebuflen

);

 

Parameters

 

Doc

[in] Specifies a document that PXCV_Init created.

 

name

[in] Pointer to an ASCII string that defines the information key (Title, Author, Subject etc) for the value to be retrieved. Please note that this parameter is case-sensitive and incompatible with UNICODE.

 

value

[in/out] Specifies a pointer to a buffer where retrieved information is placed. If this parameter is set to NULL then the required buffer size will be placed in valuebuflen. Buffer sizes are given in characters.

 

valuebuflen

[in/out] Specifies an available buffer size. Buffer sizes are given in characters, and a null-terminating character is included. If value is NULL then valuebuflen will write the required buffer size in characters. If value is not NULL then valuebuflen will write the character count, including a null-terminating character, and place it into a buffer.

 

Please note that all functions and parameters are case-sensitive.

 

Return Values

 

If the function fails then the return value is an error code.

 

If the function succeeds then the return value is DS_OK, or a different value that is not an error code.

 

Example (C++)

 

LPCWSTR GetAuthor(PXVDocument Doc)

{

LPWSTR res = NULL;

DWORD sz = 0;

HRESULT hr = PXCV_GetDocumentInfoW(Doc, "Author", res, &sz);

if (IS_DS_FAILED(hr) || (sz == 0))

return res;

res = new WCHAR[sz + 1];

PXCV_GetDocumentInfoW(Doc, "Author", res, &sz);

return res;

}