GetDeviceCaps and wpdf_DC

  • I have a problem using wpdfControl dll, version 2.5.6.2.

    When I set the page size via WPDF_StartPageEx(x, y, 0), I actually get the desired page size in the resulting document.
    But when I try to retrieve the current page size via
    GetDeviceCaps(wpdf_DC(), HORZRES),
    I don't get the size I've previously set via StartPageEx. Instead it seems GetDeviceCaps returns a value corresponding to a A4 paper, which is the default paper size for the printer. This is the same whatever (x,y) values I pass to StartPageEx.

    So the question is: why GetDeviceCaps does not return the correct result for HORZRES and VERTRES?

    • Offizieller Beitrag

    Hi,

    wPDFControl internally creates a metafile which is used to record the GDI API calls. HORZRES and VERTRES identifies the physical size of the reference device (screen or printer). It does not possible to change this values. So the GetDeviceCaps will always return values which correct for the reference device.

    Julian