Convert to Page Description Language formats with advanced 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 the PageDescriptionLanguageConvertOptions class to specify Page Description Language (PDL) file format conversion settings. This class implements IPagedConvertOptions, IPageRangedConvertOptions, and IWatermarkedConvertOptions for page selection, page range specification, and watermark support.

Supported Page Description Language Formats

The following PDL (Page Description Language) formats are supported:

FormatExtensionDescription
SVG.svgScalable Vector Graphics (XML-based vector format)
SVGZ.svgzCompressed SVG using GZIP
XPS.xpsXML Paper Specification (Microsoft)
OXPS.oxpsOpen XML Paper Specification
EPS.epsEncapsulated PostScript
PS.psPostScript Document
PCL.pclPrinter Command Language (HP)
TEX.texLaTeX Source Document
CGM.cgmComputer Graphics Metafile

Properties

Format - Specifies the desired PDL file format. Available options are: Svg, Svgz, Xps, Oxps, Eps, Ps, Pcl, Tex, Cgm.

Width - Sets the desired page width in pixels.

Height - Sets the desired page height in pixels.

PageNumber - Specifies the starting page number for conversion.

PagesCount - Specifies the number of pages to convert.

Pages - Specifies a list of specific page numbers to convert.

Watermark - Applies a watermark to the converted document.

Conversion Examples

PageDescriptionLanguageConvertOptions supports conversion between PDL formats. The following examples demonstrate common conversions.

XPS to SVG

Convert an XPS document to SVG (Scalable Vector Graphics):

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

string sourceFile = "document.xps";
string outputFile = "document.svg";

using (var converter = new Converter(sourceFile))
{
    var options = new PageDescriptionLanguageConvertOptions
    {
        Format = PageDescriptionLanguageFileType.Svg
    };
    converter.Convert(outputFile, options);
}

EPS to XPS

Convert an EPS (Encapsulated PostScript) file to XPS:

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

string sourceFile = "illustration.eps";
string outputFile = "illustration.xps";

using (var converter = new Converter(sourceFile))
{
    var options = new PageDescriptionLanguageConvertOptions
    {
        Format = PageDescriptionLanguageFileType.Xps
    };
    converter.Convert(outputFile, options);
}

PostScript to SVG

Convert a PostScript (PS) file to SVG:

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

string sourceFile = "print-file.ps";
string outputFile = "print-file.svg";

using (var converter = new Converter(sourceFile))
{
    var options = new PageDescriptionLanguageConvertOptions
    {
        Format = PageDescriptionLanguageFileType.Svg
    };
    converter.Convert(outputFile, options);
}

Custom Dimensions

Control output page dimensions using Width and Height properties:

Using Custom Page Dimensions

Define custom page width and height in pixels:

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

string sourceFile = "technical-diagram.xps";
string outputFile = "technical-diagram.svg";

using (var converter = new Converter(sourceFile))
{
    var options = new PageDescriptionLanguageConvertOptions
    {
        Format = PageDescriptionLanguageFileType.Svg,
        Width = 800,   // Width in pixels
        Height = 600   // Height in pixels
    };
    converter.Convert(outputFile, options);
}

Watermark Support

Add text or image watermarks to converted documents:

Adding Text Watermark

Apply a text watermark to the converted document:

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

string sourceFile = "confidential.xps";
string outputFile = "confidential.svg";

using (var converter = new Converter(sourceFile))
{
    var options = new PageDescriptionLanguageConvertOptions
    {
        Format = PageDescriptionLanguageFileType.Svg,
        Watermark = new WatermarkTextOptions("CONFIDENTIAL")
        {
            Color = System.Drawing.Color.Red,
            Width = 200,
            Height = 50,
            Top = 100,
            Left = 100
        }
    };
    converter.Convert(outputFile, options);
}

Format Support Notes

PDL to PDL conversions are supported for most format combinations:

  • XPS → SVG, EPS, PS, PCL, TEX
  • EPS → SVG, XPS, PS, PCL, TEX
  • PS → SVG, XPS, EPS, PCL, TEX
  • SVG → XPS, EPS, PS, PCL, TEX
  • TEX → SVG, XPS, EPS, PS, PCL
  • PCL → SVG, XPS, EPS, PS, TEX

Note: To convert FROM PDL formats to PDF or images, use PdfConvertOptions or ImageConvertOptions.

More Resources