Present Classification Station: Error trying to create optimized pdf,and getting error in Present classification station

Error Log

RemoteException wrapping UiPath.DocumentUnderstanding.Digitizer.Exceptions.PdfOptimizationFailedException: Error trying to create optimized pdf —> RemoteException wrapping UiPath.DocumentUnderstanding.Digitizer.Exceptions.PdfOptimizationFailedException: Error trying to create optimized pdf —> RemoteException wrapping System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)
at System.Drawing.Image.Save(Stream stream, ImageFormat format)
at .( , Image )
at BitMiracle.Docotic.Pdf.PdfDocumentGdiExtensions.AddImage(PdfDocument doc, Image image)
at UiPath.DocumentUnderstanding.Digitizer.Utils.PdfImageUtils.DrawImageInPdf(PdfDocument pdf, PdfPage page, Image image, Single scale)
at UiPath.DocumentUnderstanding.Digitizer.Optimization.Processors.TiffImageProcessor.CreatePdfFromImages(PdfDocument pdf, List1 images) at UiPath.DocumentUnderstanding.Digitizer.Optimization.Processors.TiffImageProcessor.TryCreateOptimizedPdf(Stream input, Stream output, String contentType, WrappedStreamConfiguration streamConfiguration) at UiPath.DocumentUnderstanding.Digitizer.Optimization.DefaultOptimizedPdfBuilder.GenerateOptimizedPdf(Stream input, Stream output, String contentType) --- End of inner exception stack trace --- at UiPath.DocumentUnderstanding.Digitizer.Optimization.DefaultOptimizedPdfBuilder.GenerateOptimizedPdf(Stream input, Stream output, String contentType) at UiPath.SmartData.PDF.Optimization.DefaultOptimizedPdfBuilder.<CreateOptimizedPdf>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.SmartData.PDF.Optimization.DefaultOptimizedPdfBuilder.<GenerateOptimizedPdf>d__3.MoveNext() --- End of inner exception stack trace --- at UiPath.SmartData.PDF.Optimization.DefaultOptimizedPdfBuilder.<GenerateOptimizedPdf>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.SmartData.ClassificationStation.Host.Local.ClassificationStationPresenter.<GenerateOptimizedPdf>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.SmartData.ClassificationStation.Host.Local.ClassificationStationPresenter.<CreateServiceAndPrepareContent>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.SmartData.ClassificationStation.Host.Local.ClassificationStationPresenter.<Show>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.SmartData.OutOfProcessUi.Common.Server.OutOfProcessUiService.<>c__DisplayClass3_02.<b__0>d.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.SmartData.OutOfProcessUi.Common.Server.OutOfProcessUiService.d__32.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.SmartData.OutOfProcessUi.Common.Server.OutOfProcessUiService.<OpenClassificationStation>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.CoreIpc.Server.<InvokeMethod>d__22.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.CoreIpc.Server.<HandleRequest>d__21.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.CoreIpc.Server.<>c__DisplayClass4_2.<<-ctor>b__6>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.CoreIpc.IOHelpers.<WithResult>d__12.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.CoreIpc.IOHelpers.<WithTimeout>d__181.MoveNext()

Hi ,I am trying to classify document using Machine learning classifier ,but when I run the file I am getting following errors ,and also Validated Classification Results is showing null ,I have attached a screenshot. Kindly help me with the same

Did you try this by running only one page of the PDF?

1 Like

No,actually documents is in TIF formats,and it has multiple pages in single documents

That’d be great if you can share the TIF file for us to run.

Else we can go step by step to understand what is that which is causing this error:

  1. We can first check if the DOM is created correctly, either print of see the execution in debug mode and use a breakpoint after the DOM is created

  2. if you are using OCR, try something to another one. Scanned documents goes well with Tesseract or Omni else Microsoft does the task.

  3. The issue can be at file level too, try switching to other file of same type and check.

  4. You are saying that has multiple pages, is it possible to process a file with single page first? Any others sample file?

According to me, that seems to be a issue at file level and we might need to do some manipulation before giving the file to DOU workflow.
We encountered such isse and what we did, converted the file to an pdf format and served it as an input to DOU workflow. As the original png format was giving such error at times.

Also, we are assuming the ML classifier is configured correctly, this can be checked by processing any samole file, normal text pdf to see if the workflow is working. API key and ML skills should be configured correctly.

There are some issues that we can expect when we process TIF files via DU. If you can provide the sample TIF file it would be great, otherwise, try converting it to PDF and then process it. There are many .net and python libraries that can allow you to do the same.

You can refer to the same here - Convert TFIF images to PDF

THANKS …Actually the file which i am talking about is very confidential ,my org does not allow me to share with anyone ,im really sorry for that .and as you told me to convert tiff file to pdf using that application ,i can do with 10 15 documents ,what about 100-1000 documents ,it will take so much time ryt?