Skip to main content

Dispose PDF after Printing

Version: 3.0

Dispose PDF after Printing

When done working with the PDF we recommend disposing of it explicitly by calling the Dispose method. The example below demonstrates how to dispose a PDF after printing.

InputPdf pdf = new InputPdf("DocumentA.pdf");
PrintJob printJob = new PrintJob(Printer.Default, pdf);
printJob.Print();
pdf.Dispose();
Dim pdf As InputPdf = New InputPdf("DocumentA.pdf")
Dim printJob As PrintJob = New PrintJob(Printer.Default, pdf)
printJob.Print()
pdf.Dispose()
Documentation version