This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/dotnet/load-a-file/converter/from-local-storage-more.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Load any file for conversion in C# .NET | Nutrient .NET SDK
More...

To load any supported file for conversion, use the LoadFromFile method from the GdPictureDocumentConverter class.

LoadFromFile accepts:

  • FilePath — Path to the input file.
  • DocumentFormat (optional) — A member of the DocumentFormat enumeration. You can also pass DocumentFormat.DocumentFormatUNKNOWN for auto-detection.

LoadFromFile returns a GdPictureStatus, which should always be checked before conversion.

The full list of supported input formats is available on the supported file types page.

To load and convert a file from local storage (example: Excel to PDF), use the following code:

using GdPicture14;
using System;
using GdPictureDocumentConverter converter = new GdPictureDocumentConverter();
GdPictureStatus status = converter.LoadFromFile(
@"C:\temp\source.xlsx",
DocumentFormat.DocumentFormatXLSX);
if (status != GdPictureStatus.OK)
{
Console.WriteLine($"LoadFromFile failed: {status}");
return;
}
status = converter.SaveAsPDF(@"C:\temp\output.pdf");
if (status != GdPictureStatus.OK)
{
Console.WriteLine($"SaveAsPDF failed: {status}");
}