Convert to Page Description Language formats with advanced options
Leave feedback
On this page
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.
The following PDL (Page Description Language) formats are supported:
| Format | Extension | Description |
|---|---|---|
| SVG | .svg | Scalable Vector Graphics (XML-based vector format) |
| SVGZ | .svgz | Compressed SVG using GZIP |
| XPS | .xps | XML Paper Specification (Microsoft) |
| OXPS | .oxps | Open XML Paper Specification |
| EPS | .eps | Encapsulated PostScript |
| PS | .ps | PostScript Document |
| PCL | .pcl | Printer Command Language (HP) |
| TEX | .tex | LaTeX Source Document |
| CGM | .cgm | Computer Graphics Metafile |
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.
PageDescriptionLanguageConvertOptions supports conversion between PDL formats. The following examples demonstrate common conversions.
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);
}
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);
}
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);
}
Control output page dimensions using Width and Height properties:
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);
}
Add text or image watermarks to converted documents:
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);
}
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.
- API Reference: PageDescriptionLanguageConvertOptions
- API Reference: PageDescriptionLanguageFileType
- Supported File Formats
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.