<< Click to Display Table of Contents >> Navigation: Functions > PXCV_GetPageDimensions |
PXCV_GetPageDimensions retrieves page dimensions in points.
HRESULT PXCV_GetPageDimensions(
PXVDocument Doc,
DWORD page_num,
double* width,
double* height
);
Doc
[in] Specifies a document that PXCV_Init created.
page_num
[in] Specifies the zero-based page number for which to retrieve dimensions.
width
[out] Pointer to a double variable that receives the width of the page. The measurement returned is the width (in points) of the crop box.
height
[out] Pointer to a double variable that receives the height of the page. The measurement returned is the height (in points) of the crop box.
Please note that all functions and parameters are case-sensitive.
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 isn't an error code.
HRESULT GetPageDimInPixels(PXVDocument pDoc, DWORD page_num, DWORD dpi, SIZE* dims)
{
double pw, ph;
HRESULT hr = PXCV_GetPageDimensions(pDoc, page_num, &pw, &ph);
if (IS_DS_SUCCESSFUL(hr))
{
dims.cx = (LONG)(pw * dpi / 72.0 + 0.5);
dims.cy = (LONG)(ph * dpi / 72.0 + 0.5);
}
return hr;
}