: System.IO.FileNotFoundException

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Converter for .NET (v1)  /  : System.IO.FileNotFoundException

DynamicPDF Converter for .NET (v1) Forum

 May 19 2021 9:36 AM
Been awhile since I used the converter on my development VM, but something must have changed that I can't figure out.  Exact same code is working on our server.

Getting this error:
Unhandled Exception: System.IO.FileNotFoundException: Could not find file 'C:\WINDOWS\TEMP\9d037167-b143-417e-83c2-170adfd54fa3.pdf'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
   at ceTe.DynamicPDF.Conversion.Converter.a(String A_0, Boolean A_1)
   at ceTe.DynamicPDF.Conversion.Converter.Convert(String inputFilePath, String outputFilePath, ConversionOptions conversionOptions)
   at ceTe.DynamicPDF.Conversion.Converter.Convert(Byte[] inputData, String inputFileName, String outputFilePath, ConversionOptions options)

Code:
private void ConvertRtfToBytes(string rtfString, string outputPath)
{
byte[] rtfBytes = Encoding.ASCII.GetBytes(rtfString);
Converter.Convert(rtfBytes, ".rtf", outputPath);
}

I do see it is creating a folder under C:\Windows\Temp and there is an rtf in the folder, so it seems to be prepping the rtf.
Posted by a ceTe Software moderator
Hello,

Please try changing the tempFilesPath in service's .config file and see if it works.

The service configuration file is located at: C:\Program Files\ceTe Software\DynamicPDF Converter v1.0.0 for .NET\Service\ceTe.DynamicPDF.Converter.Service.exe.config

Change the tempFilesPath in the below string in the config file to to some to other path .  Then stop and start the DynamicPDF Converter windows service for these changes to take effect.

                        <ceTe.dynamicPdf.conversion tempFilesPath="%WINDIR%\TEMP" conversionsPerProcess="1000" printHtmlBackgroundColorAndImage="true" enableLogging="true" />

Since it is working on the other server this could be a permission issue.

We recommend using latest version (v3) of DynamicPDF Converter product. You can download latest product from NuGet (Package ID: ceTe.DynamicPDF.Converter.NET) or from our website here.

Version 3 can be run with or without service. If you would like to run it with a service, then register the DynamicPDF Converter service. You can find instructions on this in Readme.txt placed DPDFConverterService folder downloaded with the product.

If you continue facing similar issue even after using latest v3 product then please send over the following information to support@dynamicpdf.com so we can look into it further.

1.        RTF file to recreate the error.
2.        Exact version and build number of v3 DynamicPDF Converter product. You can find this information by right clicking on the DLL file>>Properties>>Details tab>>Product version. You can take a screenshot of Details tab and send it over to us.

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 1:39 AM.