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

**URL:** <https://community.apryse.com/t/workaround-for-pdfs-that-dont-render-properly-when-pdfnet-setresourcespath-returns-false/308>\
**Category:** Apryse SDK\
**Created:** [May 9, 2007, 6:04pm UTC](https://community.apryse.com/t/workaround-for-pdfs-that-dont-render-properly-when-pdfnet-setresourcespath-returns-false/308 "2007-05-09T18:04:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aaron\_Gravesdale](https://community.apryse.com/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@Aaron\_Gravesdale](https://community.apryse.com/u/Aaron_Gravesdale)\
**Post date:** [May 9, 2007, 6:04pm UTC](https://community.apryse.com/t/workaround-for-pdfs-that-dont-render-properly-when-pdfnet-setresourcespath-returns-false/308/1 "2007-05-09T18:04:32Z")

</div>

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](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");
