I will update this post with what i come up with and hopefully someone has some ideas :)
OK, first off. PDFCreator is your friend when it comes to PDF creation on the fly. Just install it as printer driver and use it for conversion of whatever documents you need to convert.
The post I was mentioning above was about the ASP.NET machine account not having access to execute the printer driver. To allow this, start dcomcnfg from Run, and find the COM application you want to run, and add add ASP.NET to approved activation accounts.
Second, here is the code I've written to execute the driver:
1 public void createPDF(string strPath)
2 {
3 clsPDFCreator objPDFCreator = new clsPDFCreator();
4 clsPDFCreatorOptions objPDFCreatorOptions = new clsPDFCreatorOptions();
5
6 objPDFCreatorOptions.UseAutosave = 1;
7 objPDFCreatorOptions.AutosaveFilename = strPath + ".pdf";
8
9 objPDFCreator.cClearCache();
10
11 objPDFCreator.cOptions = objPDFCreatorOptions;
12
13 objPDFCreator.cDefaultPrinter = "PDFCreator";
14 objPDFCreator.cPrintFile(strPath);
15 objPDFCreator.cPrinterStop = true;
16 objPDFCreator.cClose();
17 System.Runtime.InteropServices.Marshal.ReleaseComObject(objPDFCreator);
18 }
Now comes my problem. It runs the ASP.NET page, without any errors, but no PDF files is generated, ARGH...
Any ideas?