How to use PDFViewCtrl.OperUrlAsync with a proxy and custom headers?

Question:

Due to security settings, we need network communication to use a Proxy, and also we need to include custom headers. Is this possible using OpenUrlAsync?

I found the following blog entry “Streaming a PDF From the Web to a Mobile or Desktop App” (https://blog.pdftron.com/2013/08/24/streaming-a-pdf-from-the-web/). But that did not cover this.

Answer:

In our latest version you can set custom headers.
http://www.pdftron.com/pdfnet/docs/PDFNet/?topic=html/M_pdftron_PDF_PDFViewCtrl_OpenURLAsync_2.htm

http://www.pdftron.com/pdfnet/docs/PDFNet/?topic=html/M_pdftron_PDF_HTTPRequestOptions_AddHeader.htm

As for proxy, if you are using the latest version of PDFNet, then it will pick up what the OS is set for.

We use WinHttp interface, so running one of the following to setup proxy, should work.

The proxycfg.exe utility on Windows XP and Windows Server 2003 or earlier.
The netsh.exe utility on Windows Vista and Windows Server 2008 or later.

for example, run command line as administrator and call

netsh winhttp set proxy a.b.c.d:x