To rasterize a page of a .pdf file, see the getThumbnail function in Drawing/Extensions/PdfiumModule/PdfiumWrapperImpl.cpp.
To write the resulting OdGiRasterImage to a file, use the RxRasterServices module:
OdRxRasterServicesPtr pRasSvcs = odrxDynamicLinker()->loadApp(RX_RASTER_SERVICES_APPNAME);
pRasSvcs->saveRasterImage(pImage, L"out.png"); // type taken from the extensionA complete example of setting up the device and saving the result is Kernel/Exports/RasterExport (see RasterExportCmd.cpp).