The printer DC should be provided by Powerbuilder and not created through CDICreateDC. Whether the code will work or not depends on whether PB gives you access to it internal printer device context, something like:
printerDC = GetPrinterDC( Job )