Knowledgebase (2300)
PowerPoint print settings allow users to control how presentation slides are printed, such as print all slides, print some selected slides, print slides with frames or not, print many slides into one page, print order, print color and so on. This article will show you how to set print options when print PowerPoint documents in C#.
Firstly, view Microsoft PowerPoint's page print settings:

Code Snippets of set print settings of PowerPoint document by using PrinterSettings object to print the presentation slides:
static void Main(string[] args)
{
//load the sample document from file
Presentation ppt = new Presentation();
ppt.LoadFromFile("Sample.pptx");
//use PrinterSettings object to print presentation slides
PrinterSettings ps = new PrinterSettings();
ps.PrintRange = PrintRange.AllPages;
ps.PrintToFile = true;
ps.PrintFileName = ("Print.xps");
//print the slide with frame
ppt.SlideFrameForPrint = true;
//print the slide with Grayscale
ppt.GrayLevelForPrint = true;
//Print 4 slides horizontal
ppt.SlideCountPerPageForPrint = PageSlideCount.Four;
ppt.OrderForPrint = Order.Horizontal;
////only select some slides to print
//ppt.SelectSlidesForPrint("1", "3");
//print the document
ppt.Print(ps);
}
Code Snippets of set print document name by using PrintDocument object to print presentation slides:
static void Main(string[] args)
{
//load the sample document from file
Presentation ppt = new Presentation();
ppt.LoadFromFile("Sample.pptx");
//use PrintDocument object to print presentation slides
PresentationPrintDocument document = new PresentationPrintDocument(ppt);
//print document to virtual printer
document.PrinterSettings.PrinterName = "Microsoft XPS Document Writer";
//print the slide with frame
ppt.SlideFrameForPrint = true;
//print 4 slides horizontal
ppt.SlideCountPerPageForPrint = PageSlideCount.Four;
ppt.OrderForPrint = Order.Horizontal;
//print the slide with Grayscale
ppt.GrayLevelForPrint = true;
//set the print document name
document.DocumentName = "Print Task";
document.PrinterSettings.PrintToFile = true;
document.PrinterSettings.PrintFileName = ("Print.xps");
ppt.Print(document);
}
PostScript was developed by Adobe Systems in the 1980s as a way of turning digital graphics or text files into a fixed format ready for printing. With the passage time, although the PostScript (PS) file format is no longer as popular as it once was, now it is still supported by most printers. In this article, you will learn how to how to programmatically convert a PDF file to a PostScript (PS) file using Spire.PDF for .NET.
Install Spire.PDF for .NET
To begin with, you need to add the DLL files included in the Spire.PDF for.NET package as references in your .NET project. The DLL files can be either downloaded from this link or installed via NuGet.
PM> Install-Package Spire.PDF
Convert PDF to PostScript in C# and VB.NET
Converting PDF to PS can improve the quality of the printed output. With Spire.PDF for .NET, you can complete the conversion with only three lines of code. The following are the detailed steps.
- Create a PdfDocument instance.
- Load a sample PDF file using PdfDocument.LoadFromFile() method.
- Save the PDF file as a PS file using PdfDocument.SaveToFile(string filename, FileFormat.POSTSCRIPT) method.
- C#
- VB.NET
using Spire.Pdf;
namespace PDFtoPS
{
class Program
{
static void Main(string[] args)
{
//Create a PdfDocument instance
PdfDocument document = new PdfDocument();
//Load a sample PDF file
document.LoadFromFile("Test.pdf");
//Save the PDF file as a PS file
document.SaveToFile("toPostScript.ps", FileFormat.POSTSCRIPT);
}
}
}

Apply for a Temporary License
If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.
Converting a PDF to PCL (Printer Command Language) in C# can be an essential task for developers working with printing solutions. PCL is a well-established page description language used by many laser printers, and converting documents into this format allows for more efficient and accurate printing.
In this article, we will explore the process of converting PDFs to PCL format in C# using Spire.PDF for .NET, including batch conversion for processing multiple files efficiently.
- • Install Spire.PDF for .NET
- • How to Convert PDF to PCL in C#
- • Batch Conversion of PDF to PCL using C#
Install Spire.PDF for .NET
To get started, you’ll need to install the Spire.PDF for .NET library in your project. The easiest way to do this is via NuGet.
- 1.Open “NuGet Package Manager” in Visual Studio.
- 2.Search for “Spire.PDF” and install the package.
Alternatively, you can run the following command in the Package Manager Console:
PM> Install-Package Spire.PDF
How to Convert PDF to PCL in C#
Once the Spire.PDF library is installed, you're ready to start converting PDF documents into PCL. The classes and methods used for conversion are explained below:
- PdfDocument: This class represents the PDF document you're working with.
- LoadFromFile(): This method loads the PDF file into the PdfDocument object.
- SaveToFile(): This method saves the loaded PDF document in the specified format (PCL in this case).
Code Example:
- C#
using Spire.Pdf;
namespace PDFtoPCL
{
class Program
{
static void Main(string[] args)
{
// Create a PdfDocument instance
PdfDocument pdf = new PdfDocument();
// Load a PDF file
pdf.LoadFromFile("Input1.pdf");
// Save to PCL format
pdf.SaveToFile("PdfToPcl.pcl", FileFormat.PCL);
pdf.Close();
}
}
}

Batch Conversion of PDF to PCL using C#
If you need to convert a large number of PDF files in a folder, you can perform batch conversion by following the below steps and code:
- 1. Get all PDF files in a specified folder using the Directory.GetFiles() method.
- 2. Use foreach loop to iterate over each PDF file.
- 3. Load each PDF file into the PdfDocument object.
- 4. Generate the output PCL file path, and then convert the PDF to PCL.
Code Example:
- C#
using Spire.Pdf;
using System.IO;
namespace PDFtoPCL
{
class Program
{
static void Main(string[] args)
{
string pdfFolder = @"F:\PDFs\";
string pclFolder = @"F:\PCLs\";
// Get all PDF files in a folder
string[] pdfFiles = Directory.GetFiles(pdfFolder, "*.pdf");
// Iterate through each PDF file
foreach (string pdfFile in pdfFiles)
{
// Load the PDF file into the PdfDocument object
PdfDocument pdf = new PdfDocument();
pdf.LoadFromFile(pdfFile);
// Define the file path and file name of the output PCL file
string outputFile = Path.Combine(pclFolder, Path.GetFileNameWithoutExtension(pdfFile) + ".pcl");
// Save PDF as PCL file
pdf.SaveToFile(outputFile, FileFormat.PCL);
pdf.Close();
}
}
}
}

Conclusion
With Spire.PDF for .NET, converting PDFs to PCL in C# becomes straightforward, whether you're handling individual files or bulk operations. Its robust API makes it an excellent choice for automating printing workflows or integrating conversion features into applications.
Get a Free License
To fully experience the capabilities of Spire.PDF for .NET without any evaluation limitations, you can request a free 30-day trial license.