Load page description language document with options

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Conversion MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-conversion -- dnx GroupDocs.Conversion.Mcp --yes
Folders, licensing and more →

GroupDocs.Conversion provides PageDescriptionLanguageLoadOptions to control how source page description language (PDL) documents are processed. PDL documents include formats like XPS, SVG, EPS, PostScript (PS), TEX, and PCL.

The following options are available:

OptionDescription
FormatThe document type is auto-detected during loading, but you can explicitly specify the source format. Available options include: Xps, Eps, Svg, Ps, Tex, Pcl, Cgm, Oxps
Note
For SVG and SVGZ documents, use SvgLoadOptions. It controls the external resources and scripts of the document, and since version 26.10 it is the default load options type for these formats. PageDescriptionLanguageLoadOptions has no external resource control.

Load XPS document

The following code snippet shows how to load an XPS document with explicit format specification:

using GroupDocs.Conversion;
using GroupDocs.Conversion.FileTypes;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.Options.Load;

Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new PageDescriptionLanguageLoadOptions
{
    Format = PageDescriptionLanguageFileType.Xps
};

using (Converter converter = new Converter("document.xps", getLoadOptions))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("document.pdf", options);
}

Load EPS document

The following code snippet shows how to load an EPS (Encapsulated PostScript) document:

using GroupDocs.Conversion;
using GroupDocs.Conversion.FileTypes;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.Options.Load;

Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new PageDescriptionLanguageLoadOptions
{
    Format = PageDescriptionLanguageFileType.Eps
};

using (Converter converter = new Converter("vector-graphic.eps", getLoadOptions))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("vector-graphic.pdf", options);
}

Load PostScript document

The following code snippet shows how to load a PostScript (PS) document:

using GroupDocs.Conversion;
using GroupDocs.Conversion.FileTypes;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.Options.Load;

Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new PageDescriptionLanguageLoadOptions
{
    Format = PageDescriptionLanguageFileType.Ps
};

using (Converter converter = new Converter("print-file.ps", getLoadOptions))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("print-file.pdf", options);
}

Convert XPS to SVG

The following code snippet shows how to load an XPS document and convert it to SVG:

using GroupDocs.Conversion;
using GroupDocs.Conversion.FileTypes;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.Options.Load;

Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new PageDescriptionLanguageLoadOptions
{
    Format = PageDescriptionLanguageFileType.Xps
};

using (Converter converter = new Converter("layout.xps", getLoadOptions))
{
    PageDescriptionLanguageConvertOptions options = new PageDescriptionLanguageConvertOptions
    {
        Format = PageDescriptionLanguageFileType.Svg
    };
    converter.Convert("layout.svg", options);
}

Convert EPS to SVG

The following code snippet shows how to convert from EPS to SVG format:

using GroupDocs.Conversion;
using GroupDocs.Conversion.FileTypes;
using GroupDocs.Conversion.Options.Convert;
using GroupDocs.Conversion.Options.Load;

Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new PageDescriptionLanguageLoadOptions
{
    Format = PageDescriptionLanguageFileType.Eps
};

using (Converter converter = new Converter("illustration.eps", getLoadOptions))
{
    PageDescriptionLanguageConvertOptions options = new PageDescriptionLanguageConvertOptions
    {
        Format = PageDescriptionLanguageFileType.Svg
    };
    converter.Convert("illustration.svg", options);
}