Dispose PDF after Printing

When finished printing a PDF it is recommend you dispose of the PDF by explicitly calling the InputPdf instance's Dispose method.

public void Dispose()

The Dispose method cleans up any resources that were used to create the print job. The following example illustrates.

InputPdf pdf = new InputPdf(pdfFilePath);
PrintJob printJob = new PrintJob(Printer.Default, pdf);
printJob.Print();
pdf.Dispose();       
Dim pdf As InputPdf = New InputPdf(pdfFilePath)
Dim printJob As PrintJob = New PrintJob(Printer.Default, pdf)
printJob.Print()
pdf.Dispose()

In this topic