Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
Questiondatatable . help needed Pin
superselector1-Oct-13 18:56
superselector1-Oct-13 18:56 
AnswerRe: datatable . help needed Pin
Abhinav S1-Oct-13 21:09
Abhinav S1-Oct-13 21:09 
AnswerRe: datatable . help needed Pin
Andy_L_J1-Oct-13 22:20
Andy_L_J1-Oct-13 22:20 
QuestionExternal component has thrown an exception Pin
Member 102708251-Oct-13 18:13
Member 102708251-Oct-13 18:13 
AnswerRe: External component has thrown an exception Pin
Abhinav S1-Oct-13 20:44
Abhinav S1-Oct-13 20:44 
GeneralRe: External component has thrown an exception Pin
Member 102708252-Oct-13 0:38
Member 102708252-Oct-13 0:38 
GeneralRe: External component has thrown an exception Pin
Dave Kreskowiak2-Oct-13 4:37
mveDave Kreskowiak2-Oct-13 4:37 
GeneralRe: External component has thrown an exception Pin
ramonminarro11-Mar-22 3:10
ramonminarro11-Mar-22 3:10 
I have the same problem.

I describe the issue:
The process that not work sometimes is a MTA Process it have that code:

VB
Protected Friend Function PrintCustomDriver(printerSetting As PrinterSettingsAvanzada) As Boolean
  Dim sucess As Boolean = True
  Dim impresoradefecto As String = HumanoSoftware.Helpers.WindowUtil.GetDefaultPrinter
  Try
    Using document = PdfiumViewer.PdfDocument.Load(path)
                   
      Using printDocument = document.CreatePrintDocument()
         Dim printerDuplicado As PrinterSettingsAvanzada = printerSetting.Clone
         printerDuplicado.Copies = 1
         printDocument.PrinterSettings = printerDuplicado
         printDocument.PrintController = New System.Drawing.Printing.StandardPrintController()
      
         For indice As Integer = 0 To printerSetting.Copies - 1
            printDocument.Print()
         Next
      End Using
    End Using
  Catch ex As Exception
    Logger.EscribirException(ex)
    sucess = False
  Finally
    HumanoSoftware.Helpers.WindowUtil.SetDefaultPrinter(impresoradefecto)
  End Try
  
  Return sucess
End Function


Normally it works fine, However, sometimes throw that exception:

Quote:
[33][10/03/2022][10:23:23:170][ERROR][. Un componente externo produjo una excepción.. en PdfiumViewer.NativeMethods.Imports.FPDF_RenderPage(IntPtr dc, IntPtr page, Int32 start_x, Int32 start_y, Int32 size_x, Int32 size_y, Int32 rotate, FPDF flags)
en PdfiumViewer.NativeMethods.FPDF_RenderPage(IntPtr dc, IntPtr page, Int32 start_x, Int32 start_y, Int32 size_x, Int32 size_y, Int32 rotate, FPDF flags)
en PdfiumViewer.PdfFile.RenderPDFPageToDC(Int32 pageNumber, IntPtr dc, Int32 dpiX, Int32 dpiY, Int32 boundsOriginX, Int32 boundsOriginY, Int32 boundsWidth, Int32 boundsHeight, FPDF flags)
en PdfiumViewer.PdfDocument.Render(Int32 page, Graphics graphics, Single dpiX, Single dpiY, Rectangle bounds, PdfRenderFlags flags)
en PdfiumViewer.PdfPrintDocument.RenderPage(PrintPageEventArgs e, Int32 page, Double left, Double top, Double width, Double height)
en PdfiumViewer.PdfPrintDocument.PrintSinglePage(PrintPageEventArgs e)
en PdfiumViewer.PdfPrintDocument.OnPrintPage(PrintPageEventArgs e)
en System.Drawing.Printing.PrintDocument._OnPrintPage(PrintPageEventArgs e)
en System.Drawing.Printing.PrintController.PrintLoop(PrintDocument document)
en System.Drawing.Printing.PrintController.Print(PrintDocument document)
en System.Drawing.Printing.PrintDocument.Print()
en HumanoSoftware.GestorDocumental.Pdf.Documento.ImprimirCustomDriver(PrinterSettingsAvanzada printerSetting)Line numberBlush | :O
ColumnBlush | :O
]


I don't understand witch are the reasons of the exception

Thanks in advance.
GeneralRe: External component has thrown an exception Pin
Dave Kreskowiak11-Mar-22 3:46
mveDave Kreskowiak11-Mar-22 3:46 
QuestionC# assignment please help Pin
bmulgrew11-Oct-13 18:07
professionalbmulgrew11-Oct-13 18:07 
AnswerRe: C# assignment please help Pin
Abhinav S1-Oct-13 21:10
Abhinav S1-Oct-13 21:10 
AnswerRe: C# assignment please help Pin
OriginalGriff1-Oct-13 21:25
mveOriginalGriff1-Oct-13 21:25 
GeneralDestructors Pin
N8tiv1-Oct-13 15:34
N8tiv1-Oct-13 15:34 
GeneralRe: Destructors Pin
Richard Andrew x641-Oct-13 16:29
professionalRichard Andrew x641-Oct-13 16:29 
GeneralRe: Destructors Pin
N8tiv1-Oct-13 16:31
N8tiv1-Oct-13 16:31 
GeneralRe: Destructors Pin
Richard Andrew x641-Oct-13 17:09
professionalRichard Andrew x641-Oct-13 17:09 
GeneralRe: Destructors Pin
Dave Kreskowiak1-Oct-13 17:05
mveDave Kreskowiak1-Oct-13 17:05 
GeneralRe: Destructors Pin
Richard Andrew x641-Oct-13 17:08
professionalRichard Andrew x641-Oct-13 17:08 
GeneralRe: Destructors Pin
Keith Barrow1-Oct-13 22:45
professionalKeith Barrow1-Oct-13 22:45 
GeneralRe: Destructors Pin
N8tiv1-Oct-13 19:56
N8tiv1-Oct-13 19:56 
AnswerRe: Destructors Pin
Ron Beyer1-Oct-13 17:48
professionalRon Beyer1-Oct-13 17:48 
GeneralRe: Destructors Pin
jschell2-Oct-13 8:42
jschell2-Oct-13 8:42 
AnswerRe: Destructors Pin
Abhinav S1-Oct-13 21:12
Abhinav S1-Oct-13 21:12 
GeneralRe: Destructors Pin
Pete O'Hanlon1-Oct-13 21:58
mvePete O'Hanlon1-Oct-13 21:58 
QuestionEager Loading Problem Pin
eddieangel1-Oct-13 11:53
eddieangel1-Oct-13 11:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.