PDF.Convert.ToXod exception with PDFTron PDFNet on ASP.NET application

Hi
i try to integrate a pdftron.PDF.Convert.ToXod (PDFNET.DLL V6.1.0.21657) call in a ASP.NET web page (in a 32 bits application)

It works correctly when i publish on IIS on my computer (windows 7 64 bits with MS Office)
I try to deploy on a IIS server on Windows 2008 R2 server 64 bits but without MS Office. I've installed the "PDFTron PDFNet" printer with pdfnetDrivers 64 bits.

I run my converstion under impersonnalisation (with a local admin account) and i always have:

Exception:
   Message: An error occurred while converting the file.
Detailed error:
  Unable to set default printer to PDFNet printer
   Conditional expression: false
   Filename : Convert.cpp
   Function : trn::PDF::Convert::ToPdf
   Linenumber : 1744

Best regards

Gilles Barrioz

It looks like there is a permission issue (i.e. your process does not sufficient rights).
As the message says, SetDefaultPrinter() is returning 0.

So you can debug this independently from PDFNet.

Not sure if you saw this article previously:
http://www.pdftron.com/pdfnet/faq_files/Converting_Documents_in_Windows_Service_or_ASP.NET_Application_using_PDFNet.pdf

It mainly talks about configuring PDFNet along with MS Office (which we recommend for Office format conversions), so you may need additional permissions for virtual driver processing (e.g. you may need to run under "LOCAL SYSTEM” identity etc).

On Thursday, November 21, 2013 7:16:32 AM UTC-8, Gilles Barrioz wrote:

Hi
i try to integrate a pdftron.PDF.Convert.ToXod (PDFNET.DLL V6.1.0.21657) call in a ASP.NET web page (in a 32 bits application)

It works correctly when i publish on IIS on my computer (windows 7 64 bits with MS Office)
I try to deploy on a IIS server on Windows 2008 R2 server 64 bits but without MS Office. I’ve installed the “PDFTron PDFNet” printer with pdfnetDrivers 64 bits.

I run my converstion under impersonnalisation (with a local admin account) and i always have:

Exception:
Message: An error occurred while converting the file.
Detailed error:
Unable to set default printer to PDFNet printer

Best regards

Gilles Barrioz

it was a impersonnalisation probleme,i solved it by using a external program (console) to make convertion and by running this program with the advapi32 CreateProcessAsUser (http://support.microsoft.com/kb/889251)

I’ve also install Micorosft Office (2007 SP2)
Regards
Gilles
Le jeudi 21 novembre 2013 19:22:29 UTC+1, Support a écrit :

It looks like there is a permission issue (i.e. your process does not sufficient rights).
As the message says, SetDefaultPrinter() is returning 0.

So you can debug this independently from PDFNet.


Not sure if you saw this article previously:
http://www.pdftron.com/pdfnet/faq_files/Converting_Documents_in_Windows_Service_or_ASP.NET_Application_using_PDFNet.pdf

It mainly talks about configuring PDFNet along with MS Office (which we recommend for Office format conversions), so you may need additional permissions for virtual driver processing (e.g. you may need to run under "LOCAL SYSTEM” identity etc).

On Thursday, November 21, 2013 7:16:32 AM UTC-8, Gilles Barrioz wrote:

Hi
i try to integrate a pdftron.PDF.Convert.ToXod (PDFNET.DLL V6.1.0.21657) call in a ASP.NET web page (in a 32 bits application)

It works correctly when i publish on IIS on my computer (windows 7 64 bits with MS Office)
I try to deploy on a IIS server on Windows 2008 R2 server 64 bits but without MS Office. I’ve installed the “PDFTron PDFNet” printer with pdfnetDrivers 64 bits.

I run my converstion under impersonnalisation (with a local admin account) and i always have:

Exception:
Message: An error occurred while converting the file.
Detailed error:
Unable to set default printer to PDFNet printer

Best regards

Gilles Barrioz