# How to print the comparing result

**URL:** <https://faq.inetsoftware.de/t/how-to-print-the-comparing-result/56>\
**Category:** API\
**Tags:** version4, version3\
**Created:** [June 7, 2016, 12:45pm UTC](https://faq.inetsoftware.de/t/how-to-print-the-comparing-result/56 "2016-06-07T12:45:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RichardRoedel](https://faq.inetsoftware.de/user_avatar/faq.inetsoftware.de/richardroedel/32/27_2.png) [@RichardRoedel](https://faq.inetsoftware.de/u/RichardRoedel)\
**Post date:** [June 7, 2016, 12:45pm UTC](https://faq.inetsoftware.de/t/how-to-print-the-comparing-result/56/1 "2016-06-07T12:45:33Z")

</div>

At first your should set up a printer service

```
PrintService printService = PrintServiceLookup.lookupDefaultPrintService();

```

and then use a print presenter for the comparison

```
 new PDFComparer()
            .addPresenter( new DifferencesPrintPresenter( printService, new HashPrintRequestAttributeSet()) )
            .compare( <file1>, <file2> );

```

This setting will use the default printer, if any. To define the printer to be used, the attribute set has to be filled.

[View full sourcecode](https://github.com/i-net-software/pdfc-samples/blob/master/src/main/java/print/SimpleCompareAndPrint.java)
