|
Help,
Has anyone been able to print from a web application? More specifically convert a .Doc file to a Image (.Tiff) file from a web application. I've created a desktop application which works just fine. However the same exact code which executes in the desktop app fails in a web enviornment. I've added the ASPNET user to my print driver and associated dlls giving it full access. I've also added identity impersonate = "true" in my web config file.
I'm at a loss of ideas, so anyone's help would be greatly appreciated.
Here's a snippit of code from my method.
'unlock eprint
eprint.UnlockSupport(LPEPCLib.SupportLockConstants.SUPPORT_GENERAL, L_KEY_EPRINT)
'Make sure support is unlocked...
If eprint.IsSupportLocked(LPEPCLib.SupportLockConstants.SUPPORT_GENERAL) Then
Return False
End If
Try
'Start configuring the save options by creating the eprint save object
Dim m_multisaveoptions As New LPEPCLib.EpnMultiSaveOptions
eprint.GetPrinterSaveOptions(sPrinterName, m_multisaveoptions)
m_multisaveoptions.UseSave = True
m_multisaveoptions.SaveElementsCount = 1
With m_multisaveoptions.PrinterSaveOptions(0)
.SaveOptions.DocumentOptions.MultiPageFile = True
.SaveOptions.DocumentType = LPEPCLib.DocumentTypeConstants.FT_SAVE_TYPE_RASTER
.SaveOptions.Format = LPEPCLib.ePrintFileConstants.FILE_TIF
.SaveOptions.RasterOptions.BitsPerPixel = 4
.SaveOptions.RasterOptions.QFactor = 3
.SaveOptions.RasterOptions.MultiPageFile = True
.SaveOptions.RasterOptions.UseFileSize = True
.SaveOptions.RasterOptions.Passes = 2
End With
'save the saveoptions object to eprint
eprint.EnableShowUIEvent(sPrinterName) = True
'to be revised with dynamic letter name
m_multisaveoptions.PrinterSaveOptions(0).SaveOptions.FileName = 'path of output file is declared here
eprint.SetPrinterSaveOptions(sPrinterName, m_multisaveoptions)
eprint.StartDocumentConversion(sPrinterName, 0)
MyConvertDoc(outputfile) 'This is a call to another method which just invokes the printer.
'this method should process the print jobs
eprint.EndDocumentConversion(sPrinterName, 0)
'Next
lblStatus.Text = "Finished!"
Catch ex As Exception
End Try
|