Q:
I am planning to use PDFNet SDK to develop an ActiveX control that
will be deployed over the web.
However, I noticed that PDFNet depends on the existence of an external
resource file (pdfnet.res).
Has PDFNet SDK been used for ActiveX control web deployment scenario?
------
A:
You can use PDFNet SDK for C++ to implement ActiveX control.
'pdfnet.res' is a file that is usually shipped with applications
developed using PDFNet. It standard PDF resources such as fonts, color
profiles, and CMaps. Although PDFNet can work without locating
'pdfnet.res', some files may not print or render properly. For more
information, please see: http://www.pdftron.com/net/faq.html#pdfnet_res.
There are several options to resolve the deployment issue:
A) Download 'pdfnet.res' with the control.
Then your ActiveX control is activated it can search for
'pdfnet.res' in the same folder where ActiveX component is located. If
the resource file is not found, download 'pdfnet.res' and save it in
the same folder:
char dirpath[_MAX_PATH];
if (::GetModuleFileName(gl_hModule, dirpath, _MAX_PATH))
if (PDFNet::SetResourcePath(dirpath) == false) {
... download 'pdfnet.res' from a given URL.
... save into dirpath
PDFNet::SetResourcePath(dirpath);
}
B) Add 'pdfnet.res' as a binary resource to your DLL. Using the same
approach as above you can initially extract the resource into the same
folder as your DLL. Subsequently you would use SetResourcePath()
without having to extract the resource.
C) Add 'pdfnet.res' as a binary resource to your DLL and call
PDFNet::SetResourcePath(resource_id). This SetResourcePath overload is
available in the custom version of PDFNet for Windows (since the
method is not available on other platforms). This approach it is less
efficient than options A and B and may result in the longer 'load'
time for the control.
PDFNet SDK is also available as a .NET component. The above options
related to deployment of PDFNet.DLL through the browser or over the
Net, also apply to the Dot Net platform.