Load document from local disk

To load the source file from a local disk, use the following implementations of the Converter class constructor:

All these constructors have the filePath string parameter which specifies the location of the source file. File path can be absolute or relative. If the source file does not exist, an exception occurs.

GroupDocs.Conversion opens the file for reading only when any other methods of the Converter class are called.

The following code snippet shows how to load a file from a local disk:

import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.options.convert.PdfConvertOptions;
...
Converter converter = new Converter("c:\\files\\sample.docx");
PdfConvertOptions options = new PdfConvertOptions();

converter.convert("converted.pdf", options);