System.Drawing crash when convert PDF to PDF/A

Hi, i have a little bug with my web service WCF and Aspose PDF conversion.
If i do my conversion in application mode it’s working, but when i’m doing the same code in a WCF, System.Drawing crash on a PDF with one image.

ERROR:
à System.Drawing.Bitmap…ctor(Int32 width, Int32 height, PixelFormat format)
à . (Int32 , Int32 , PixelFormat )
à …ctor( , )
à ​ . ( , )
à …ctor( , , )
à Aspose.Pdf.ImagePlacementAbsorber. (Page , OperatorCollection , Resources )
à Aspose.Pdf.ImagePlacementAbsorber. (Page , OperatorCollection , Resources )
à Aspose.Pdf.ImagePlacementAbsorber.Visit(Page page)
à Aspose.Pdf.Page.Accept(ImagePlacementAbsorber visitor)
à . (String , String )
à . ()
à . ()
à . ()
à . (XmlTextWriter , PdfFormat , Document , Boolean , ConvertErrorAction )
à Aspose.Pdf.Document. (XmlTextWriter , PdfFormat , Boolean , ConvertErrorAction , ConvertTransparencyAction )
à Aspose.Pdf.Document.Convert(String outputLogFileName, PdfFormat format, ConvertErrorAction action, ConvertTransparencyAction transparencyAction)
à Aspose.Pdf.Document.Convert(String outputLogFileName, PdfFormat format, ConvertErrorAction action)
à PDFAServiceTest.Service1.ConvertFile(String fileName, PdfFormat conformance) dans C:\ICO\Apps\Debugger\PDFAServiceTest\PDFAService.svc.vb:ligne 23
à PDFAServiceTest.Service1.ConvertFolder(String folder, PdfFormat conformance) dans C:\ICO\Apps\Debugger\PDFAServiceTest\PDFAService.svc.vb:ligne 8
à SyncInvokeConvertFolder(Object , Object[] , Object[] )
à System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
à System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)

CODE Source in the WCF:

Private Sub ConvertFile(ByVal fileName As String, ByVal conformance As Aspose.Pdf.PdfFormat)
SetLicense()

    Dim convertedFileName As String = "C:\test\Conversion\" & New System.IO.FileInfo(fileName).Name

    Dim doc As New Aspose.Pdf.Document(fileName)
    doc.Metadata.Clear()

    doc.Convert("C:\test\Conversion\" & New System.IO.FileInfo(fileName).Name & "_log.xml", conformance, Aspose.Pdf.ConvertErrorAction.None)
    doc.Save(convertedFileName, Aspose.Pdf.SaveFormat.Pdf)
End Sub

@Guillaumeico,

Kindly create a small WCF application and make sure that it reproduces this error in your environment, and then send us a Zip of this project including source PDF. We will investigate and share our findings with you.

@imran.rafique

My .zip file do not appear on the post after uploading.
Do you have mail address?

@Guillaumeico,

You can upload to any free file sharer server, e.g. Google drive, and then send us its download URL. Your response is awaited.

@imran.rafique
https://drive.google.com/file/d/1zQjT7Xy6ewrqRvFfPHGtdXX2tLdxRr_T/view?usp=sharing

@Guillaumeico,

Kindly send us the App.config file of the application project, which calls this WCF service and let us know in which format you are converting source PDF. Your response is awaited.

Hi, here (https://drive.google.com/open?id=1hAz6RvSIXV6LzzhduFS6T4LazWDyB9jW) is the app.config.
I convert the PDF in PDF/A-3B and i call the wcf like this:

Dim client As New PDFAService.PDFAClient()
client.ConvertFolder(FolderTextBox.Text, Aspose.Pdf.PdfFormat.PDF_A_3B)

@Guillaumeico,

We have created a simple WCF application and can execute your scenario without an error with the latest version 18.1 of Aspose.Pdf for .NET API. This is the output PDF: 34_out18.1.0.pdf (348.0 KB). Please download and try the latest version 18.1 of Aspose.Pdf for .NET API, and then let us know how that goes into your environment.

Same error, i record my test in a .GIF.
https://drive.google.com/open?id=1IFNhdiloevROhCUPTED6G3b8g5OOBXfx

@Guillaumeico,

We have created a small WCF service to run your scenario in our environment, and it is working fine. Please start WCF service by running HelloServiceHost project, and execute your code with the ConsoleApplication3 project (set local license file path), and then let us know how that goes into your environment.

Console app: ConsoleApplication3.zip (68.1 KB)
WCF service: https://drive.google.com/open?id=1sLczxACFJQynUUESDpXmyaVT2LPAfxdT

It’s strange…Same error…

An exception of type ‘System.ArgumentException’ occurred in System.Drawing.dll but was not handled in user code

The Parameter is not valid.

à System.Drawing.Bitmap…ctor(Int32 width, Int32 height, PixelFormat format)
à . (Int32 , Int32 , PixelFormat )
à …ctor( , )
à . ( , )
à …ctor( , ​ , )
à Aspose.Pdf.ImagePlacementAbsorber. (Page , OperatorCollection , Resources )
à Aspose.Pdf.ImagePlacementAbsorber. (Page , OperatorCollection , Resources )
à Aspose.Pdf.ImagePlacementAbsorber.Visit(Page page)
à Aspose.Pdf.Page.Accept(ImagePlacementAbsorber visitor)
à . (String , String )
à . ()
à . ()
à . ()
à . (XmlTextWriter , PdfFormat , Document , Boolean , ConvertErrorAction )
à Aspose.Pdf.Document. (XmlTextWriter , PdfFormat , Boolean , ConvertErrorAction , ConvertTransparencyAction )
à Aspose.Pdf.Document.Convert(String outputLogFileName, PdfFormat format, ConvertErrorAction action, ConvertTransparencyAction transparencyAction)
à Aspose.Pdf.Document.Convert(String outputLogFileName, PdfFormat format, ConvertErrorAction action)
à HelloService.HelloService.DoWork() dans C:\Users\marcpg\Downloads\TestAspose\HelloService\HelloService\HelloService.vb:ligne 13
à SyncInvokeDoWork(Object , Object[] , Object[] )
à System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
à System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)

@Guillaumeico,

It appears as an environmental specific error. Kindly send all details of the local environment, including Operating System (name and version), local language settings and some handy information which you think can help us to replicate the same error in our environment. Your response is awaited.

Windows 7 (x64) Pro - Service Pack 1
Intel® Core™ i7-4770 CPU @ 3.40GHz

Language region format: French (Canada)
Location: Canada

Graphic card: Nvidia GeForce GT 710

My last update on Windows is KB915597 (definition 1.261.104.0).
I use Microsoft Visual Studio 2013 in administrator mode with IIS 7.

@Guillaumeico,

We have tried with the French (Canada) language settings, but could not replicate this error in our environment. We recommend you please try both these projects on any other computer, and then let us know how that goes into your environment.

On the test server of my client and on Windows 10 dosen’t work too.
System.Drawing crash every time.

The conversion work only if i do the conversion (the serviec code) with an Window Form Application.

@Guillaumeico,

We are afraid that we could not replicate this error in Windows 10 with French (Canada) language settings. Kindly create a small solution project in the same way as you have shared in GIF, including client project (in the solution project). Please make sure that the error in reproducible, and then send us the Zip of this project. We will investigate and share our findings with you.

HI,
Here (https://drive.google.com/open?id=1Ca9GmoTxkXDZr52MQAROkzczALVTIyEi) is an new .GIF with the error on Service and sucess on Windows Form Application.

And here (https://drive.google.com/open?id=1-yMuoParYXxXAkeZFLXTpp4Bovc8cLTL) is the source (client with service)

Look the GIF before, i show you how to replicate the error with the service.

@Guillaumeico,

We managed to replicate the said error in our environment. It has been logged under the ticket ID PDFNET-44107 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates. Thank you for cooperation.