How do I fix: 'UNIDRV.dll could not be copied' when converting files via virtual print dirver

Q:

I have downloaded PDFNet SDK. But while running ConvertTest I am getting error stating UNIDRV.dll could not be copied.

A:

This error pops if you are try to convert a document via virtual printer driver and PDFNet (i.e. its virtual driver) does not match the target architecture. To fix this use a version of PDFNet that matches your OS. For more info please see: https://community.pdftron.com/t/converting-rtf-to-pdf-via-pdftron-printer/1580. Also you may need to explicitly select the target architecture in your app solution.