Load page description language document with options

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

Load XPS document

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

With v24.10 and later:

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);
}

Before v24.10:

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

Func<LoadOptions> getLoadOptions = () => 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:

With v24.10 and later:

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);
}

Before v24.10:

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

Func<LoadOptions> getLoadOptions = () => 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:

With v24.10 and later:

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);
}

Before v24.10:

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

Func<LoadOptions> getLoadOptions = () => 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:

With v24.10 and later:

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);
}

Before v24.10:

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

Func<LoadOptions> getLoadOptions = () => 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:

With v24.10 and later:

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);
}

Before v24.10:

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

Func<LoadOptions> getLoadOptions = () => 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);
}
Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.