Print Specified Area of a PDF Page
The PrintJobPageList class contains an overloaded Add method that allows you to print only a specific rectangular area of one or more PDF pages instead of the entire page. This method takes an InputPdf instance, a System.Drawing.Rectangle that defines the printable region, the starting page number, and the number of pages to print.
The following example prints only the specified rectangular area from the second and third pages of a PDF document.
InputPdf pdf = new InputPdf(pdfFilePath);
PrintJob printJob = new PrintJob(Printer.Default);
//Specify print area for the second & third pages and add them to print job.
System.Drawing.Rectangle printArea = new System.Drawing.Rectangle(0, 0, 600, 400);
printJob.Pages.Add(pdf, printArea, 2, 2);
printJob.Print();
Dim pdf As InputPdf = New InputPdf(pdfFilePath)
Dim printJob As PrintJob = New PrintJob(Printer.Default)
'Specify print area for the second & third pages and add them to print job.
Dim printArea As System.Drawing.Rectangle = New System.Drawing.Rectangle(0, 0, 600, 400)
printJob.Pages.Add(pdf, printArea, 2, 2)
printJob.Print()
[PrintAreaExample.cs](https://github.com/DynamicPDF/print-manager-dotnet-core/blob/master/print-manager-dotnet-core-cs/PrintAreaExample.cs){#gitlink-id target=_blank}
[PrintAreaExample.vb](https://github.com/DynamicPDF/print-manager-dotnet-core/blob/master/print-manager-dotnet-core-vb/PrintAreaExample.vb){#gitlink-id target=_blank}