HtmlConverter: The path is not of a legal form.

HtmlConverter: The path is not of a legal form.

Forum member · May 10, 2021
Hello, I am trying to convert a html file to pdf file. But the process throws the exception: The path is not of a legal form. at ceTe.DynamicPDF.Conversion.HtmlConverter.b(String A_0) at ceTe.DynamicPDF.Conversion.HtmlConverter.a.a() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute() The version of the library DynamicPDF.Converter.NETStandard20 is v3.9.0.43617 The OS is Windows Server 2016 Please, can you help me? Thanks

Re: HtmlConverter: The path is not of a legal form.

Support · May 10, 2021
Hello, The error indicates that the path specified for conversion is an incorrect format. Please try using a valid path for the HTML file and see if it resolves issue for you. One thing you can do to verify the path is to read the HTML file into a byte array and use it for the conversion. Here is a code sample: string SourceFilePath = @"Input HTML file path"; string DestinationFilePath = @"Output PDF file path"; byte[] input = File.ReadAllBytes(SourceFilePath); byte[] byteData = Converter.Convert(input, System.IO.Path.GetFileName(SourceFilePath)); File.WriteAllBytes(DestinationFilePath, byteData); Thanks, ceTe Software Support Team

Re: HtmlConverter: The path is not of a legal form.

Forum member · May 10, 2021
Hello, Using your code also throws the same error. The problem occurs when we use the library from a WCF webservice. From a console application it works correctly. Thanks,

Re: HtmlConverter: The path is not of a legal form.

Support · May 10, 2021
Hi, The issue is likely a permissions issue then. Make sure that the user that the WCF web service is running under has access to the path. That should resolve the issue. Thanks, ceTe Software Support Team

Re: HtmlConverter: The path is not of a legal form.

Forum member · May 11, 2021
Hi, What path use HtmlConvert? Thanks

Re: HtmlConverter: The path is not of a legal form.

Forum member · May 11, 2021
Hi, I see that the HtmlConverter.ChromiumProcessPath property is empty. It's possible that unable to extrat the necessary files. For example: BrowserProc.exe Can we manually extract the files and tell the library where they are found? Thanks

Re: HtmlConverter: The path is not of a legal form.

Forum member · May 11, 2021
Hi, My process runs under IIS. We have build a WCF service. When we run process have the next errors: Se han producido uno o varios errores. en System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) en System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) en ceTe.DynamicPDF.Conversion.Converter.Convert(Byte[] inputData, String inputFileName) en WcfServiceLibrary1.Service1.GetData(Int32 value) en C:\Program Files\GCO\TEST PDF\WcfServiceLibrary1\Service1.cs:línea 22 Se han producido uno o varios errores. en ceTe.DynamicPDF.Conversion.Converter.d(ConversionOptions A_0) en ceTe.DynamicPDF.Conversion.Converter.b(ConversionOptions A_0) en ceTe.DynamicPDF.Conversion.Converter.h.a() en System.Threading.Tasks.Task`1.InnerInvoke() en System.Threading.Tasks.Task.Execute() Se han producido uno o varios errores. en ceTe.DynamicPDF.Conversion.HtmlConverter.b(String A_0) en ceTe.DynamicPDF.Conversion.HtmlConverter.a.a() en System.Threading.Tasks.Task`1.InnerInvoke() en System.Threading.Tasks.Task.Execute() Se han producido uno o varios errores. en System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) en System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) en zz93.c.a.a() en System.Threading.Tasks.Task`1.InnerInvoke() en System.Threading.Tasks.Task.Execute() Conversion failed. Refer inner exception for details. en zz93.c.o.MoveNext() --- Fin del seguimiento de la pila de la ubicación anterior donde se produjo la excepción --- en System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() en zz93.c.o.MoveNext() --- Fin del seguimiento de la pila de la ubicación anterior donde se produjo la excepción --- en System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() en System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) en zz93.c.m.MoveNext() Se han producido uno o varios errores. en zz93.c.o.MoveNext() Error al enviar la solicitud. en System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() en System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) en ceTe.DynamicPDF.Conversion.DevTools.RuntimeCLI.Chrome.<CreateNewSession>d__6.MoveNext() No es posible conectar con el servidor remoto en System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) en System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) La dirección solicitada no es válida en este contexto en System.Net.Sockets.Socket.BeginConnectEx(EndPoint remoteEP, Boolean flowContext, AsyncCallback callback, Object state) en System.Net.Sockets.Socket.UnsafeBeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state) en System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)

Re: HtmlConverter: The path is not of a legal form.

Forum member · May 12, 2021
Hi, We have fixed the issue. Thanks

Re: HtmlConverter: The path is not of a legal form.

Forum member · May 12, 2021
Hi, We have fixed the issue. Thanks

Re: HtmlConverter: The path is not of a legal form.

Forum member · May 12, 2021
Hi, We have fixed the issue. Thanks