Workaround for PDFs that don't render properly when PDFNet.SetResourcesPath() returns false.

Q:

I an interested in creation of images from PDF pages.
I've made several tests with many PDF files and it's working all
right.

I only have a problem with one of them. On one specific file, it's
working for the first page, but not for all the other ones.

I'm working this way :

Dim draw As PDFDraw = New PDFDraw
Dim encoder_param As SDF.Obj = PDFTRON.SDF.Obj.CreateDict()
encoder_param.Put("Quality", PDFTRON.SDF.Obj.CreateNumber(100))

PDFNet.SetResourcesPath("/ressources")

draw.SetDPI(dDpi)
draw.SetImageSize(iWidth, iHeight, True)
draw.Export(itr.Current(), outname, "JPEG", encoder_param)

But it is complaining : "
Message "Exception: Message: Searching for 'pdfnet.res'. Use
PDFNet::SetResourcesPath() to set the correct resource path.
Conditional expression: doc
Filename : FontUtil.hpp
Function : PDFTRON::PDF::Fnt::StdFontSingleton::Init
-----

A:
This error indicates that PDFNet couldn't locate the resource file
(pdfnet.res). In this case PDFNet.SetResourcesPath will also return
false.

For more information, please see http://www.pdftron.com/net/faq.html#pdfnet_res.
Since many PDF documents do not rely on standard PDF resources,
rendering may seem to work fine until you encounter a file that needs
to access 'pdfnet.res'.

To address this issue you can specify a correct path to 'pdfnet.res'
as described in the above FAQ.

P.S.
I noticed that the JPEG quality encoder 'hint' is not constructed
correctly. The proper format is:

Obj hint = Obj.CreateArray();
hint.PushBack(Obj.CreateName("JPEG"));
hint.PushBack(Obj.CreateName("Quality"));
hint.PushBack(Obj.CreateNumber(100));

or alternatively you can export the image as PNG, preserving full
quality:

draw.Export(page, outname, "PNG");