# API

**URL:** https://faq.inetsoftware.de/c/i-net-pdfc/api/9.md

[Latest](https://faq.inetsoftware.de/latest.md) · [Categories](https://faq.inetsoftware.de/categories.md) · [Tags](https://faq.inetsoftware.de/tags.md)

---

## [How to specify the export file for PDF reports/exports](https://faq.inetsoftware.de/t/how-to-specify-the-export-file-for-pdf-reports-exports/53)

<div class="topic-metadata">

**Author:** [@RichardRoedel](https://faq.inetsoftware.de/u/RichardRoedel)\
**Replies:** 0\
**Last updated:** [June 7, 2016, 12:11pm UTC](https://faq.inetsoftware.de/t/how-to-specify-the-export-file-for-pdf-reports-exports/53 "2016-06-07T12:11:53Z")

</div>

For this you’ll have to create a new class which extends the default class DifferencesPDFPresenter. In this class you’ll have to override the method getExportStream(). public class PersonalDifferencesPDFPresenter exten…

---

## [How to get specific modify type](https://faq.inetsoftware.de/t/how-to-get-specific-modify-type/63)

<div class="topic-metadata">

**Author:** [@RichardRoedel](https://faq.inetsoftware.de/u/RichardRoedel)\
**Replies:** 0\
**Last updated:** [June 8, 2016, 7:05am UTC](https://faq.inetsoftware.de/t/how-to-get-specific-modify-type/63 "2016-06-08T07:05:43Z")

</div>

For this use the configuration with property CONTINUOUS\_COMPARE\_TYPES. As second value is expected CompareType.TEXT CompareType.LINE CompareType.IMAGE For example configuration.putValue( PDFCProperty.CONTINUOUS\_CO…

---

## [Automatically compare new PDFs in a folder](https://faq.inetsoftware.de/t/automatically-compare-new-pdfs-in-a-folder/47)

<div class="topic-metadata">

**Author:** [@JohnGoering](https://faq.inetsoftware.de/u/JohnGoering)\
**Replies:** 0\
**Last updated:** [June 2, 2016, 9:51am UTC](https://faq.inetsoftware.de/t/automatically-compare-new-pdfs-in-a-folder/47 "2016-06-02T09:51:56Z")

</div>

Let's create a Java app which watches a folder for file changes and automatically compares new PDFs. The idea is that any time two PDFs are added to the folder, we will run a simple comparison of the two PDFs using i-n…

---

## [How to report to a custom file path](https://faq.inetsoftware.de/t/how-to-report-to-a-custom-file-path/59)

<div class="topic-metadata">

**Author:** [@RichardRoedel](https://faq.inetsoftware.de/u/RichardRoedel)\
**Replies:** 0\
**Last updated:** [June 7, 2016, 1:39pm UTC](https://faq.inetsoftware.de/t/how-to-report-to-a-custom-file-path/59 "2016-06-07T13:39:39Z")

</div>

See the CompareAndExportToSpecificFilename sample for an additional sample along these lines. For this create a new class with extending the default class ReportPDFPresenter. In this class should now the getExportStrea…

---

## [How to use an XML Configuration](https://faq.inetsoftware.de/t/how-to-use-an-xml-configuration/60)

<div class="topic-metadata">

**Author:** [@RichardRoedel](https://faq.inetsoftware.de/u/RichardRoedel)\
**Replies:** 0\
**Last updated:** [June 8, 2016, 5:42am UTC](https://faq.inetsoftware.de/t/how-to-use-an-xml-configuration/60 "2016-06-08T05:42:32Z")

</div>

To load an XML configuration file, please use the class XMLConfiguration. This class requires an XML files as a parameter IConfiguration configuration = null; try { configuration = new XMLConfiguration( \<XML config…

---

## [How to use regex](https://faq.inetsoftware.de/t/how-to-use-regex/58)

<div class="topic-metadata">

**Author:** [@RichardRoedel](https://faq.inetsoftware.de/u/RichardRoedel)\
**Replies:** 0\
**Last updated:** [June 7, 2016, 1:25pm UTC](https://faq.inetsoftware.de/t/how-to-use-regex/58 "2016-06-07T13:25:55Z")

</div>

At first create a IConfiguration IConfiguration configuration = new DefaultConfiguration(); For this configuration now set the filter patterns with property PDFCProperty.FILTER\_PATTERNS For a filted document based o…

---

## [How to use log the result to the console](https://faq.inetsoftware.de/t/how-to-use-log-the-result-to-the-console/54)

<div class="topic-metadata">

**Author:** [@RichardRoedel](https://faq.inetsoftware.de/u/RichardRoedel)\
**Replies:** 0\
**Last updated:** [June 7, 2016, 12:27pm UTC](https://faq.inetsoftware.de/t/how-to-use-log-the-result-to-the-console/54 "2016-06-07T12:27:08Z")

</div>

To log the result to a log file or 'standard out' use a ConsolePresenter new PDFComparer() .addPresenter( new ConsolePresenter() ) .compare( \<file1\>, \<file2\> ); View full sourcecode

---

## [How to print the comparing result](https://faq.inetsoftware.de/t/how-to-print-the-comparing-result/56)

<div class="topic-metadata">

**Author:** [@RichardRoedel](https://faq.inetsoftware.de/u/RichardRoedel)\
**Replies:** 0\
**Last updated:** [June 7, 2016, 12:45pm UTC](https://faq.inetsoftware.de/t/how-to-print-the-comparing-result/56 "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() .addPresente…

---

## [How to print the comparing result with printer setting](https://faq.inetsoftware.de/t/how-to-print-the-comparing-result-with-printer-setting/57)

<div class="topic-metadata">

**Author:** [@RichardRoedel](https://faq.inetsoftware.de/u/RichardRoedel)\
**Replies:** 0\
**Last updated:** [June 7, 2016, 1:06pm UTC](https://faq.inetsoftware.de/t/how-to-print-the-comparing-result-with-printer-setting/57 "2016-06-07T13:06:35Z")

</div>

First you should define a printer and a container for the printer setting PrintService printService = PrintServiceLookup .lookupDefaultPrintService(); //use the default printservice, for testing purposes it…

---

## [How use JUnit for PDF Compares](https://faq.inetsoftware.de/t/how-use-junit-for-pdf-compares/55)

<div class="topic-metadata">

**Author:** [@RichardRoedel](https://faq.inetsoftware.de/u/RichardRoedel)\
**Replies:** 0\
**Last updated:** [June 7, 2016, 12:33pm UTC](https://faq.inetsoftware.de/t/how-use-junit-for-pdf-compares/55 "2016-06-07T12:33:53Z")

</div>

In the first step should define the files.In this example are the files in the same directory how the test class File example1 = new File( getClass().getResource( "Example1.pdf" ).getFile() ); File example2 = new File(…

---

## [How to compare two PDFs and export the result](https://faq.inetsoftware.de/t/how-to-compare-two-pdfs-and-export-the-result/52)

<div class="topic-metadata">

**Author:** [@RichardRoedel](https://faq.inetsoftware.de/u/RichardRoedel)\
**Replies:** 0\
**Last updated:** [June 7, 2016, 11:33am UTC](https://faq.inetsoftware.de/t/how-to-compare-two-pdfs-and-export-the-result/52 "2016-06-07T11:33:20Z")

</div>

First step is create a standard difference pdf presenter. We use the parent folder of the first file to store the result to. DifferencesPDFPresenter presenter = new DifferencesPDFPresenter(\<file1\>.getParentFile() ); A…

---

## [How to get the differences per page for two PDFs](https://faq.inetsoftware.de/t/how-to-get-the-differences-per-page-for-two-pdfs/51)

<div class="topic-metadata">

**Author:** [@RichardRoedel](https://faq.inetsoftware.de/u/RichardRoedel)\
**Replies:** 0\
**Last updated:** [June 7, 2016, 9:45am UTC](https://faq.inetsoftware.de/t/how-to-get-the-differences-per-page-for-two-pdfs/51 "2016-06-07T09:45:37Z")

</div>

To get the differences per page for two PDF files, start the comparison and assign the result to a local variable and the initialization one integer array for the result. ResultModel result = new PDFComparer().compare(…

---

## [How to get the total number pages of each PDF](https://faq.inetsoftware.de/t/how-to-get-the-total-number-pages-of-each-pdf/50)

<div class="topic-metadata">

**Author:** [@RichardRoedel](https://faq.inetsoftware.de/u/RichardRoedel)\
**Replies:** 0\
**Last updated:** [June 7, 2016, 9:00am UTC](https://faq.inetsoftware.de/t/how-to-get-the-total-number-pages-of-each-pdf/50 "2016-06-07T09:00:54Z")

</div>

To get the total number of pages of the two PDF files, start the comparison and assign the result to a local variable. ResultModel result = new PDFComparer().compare( \<file1\>, \<file2\> ); The information about the pag…

---

## [How to get all drawable element](https://faq.inetsoftware.de/t/how-to-get-all-drawable-element/62)

<div class="topic-metadata">

**Author:** [@RichardRoedel](https://faq.inetsoftware.de/u/RichardRoedel)\
**Replies:** 0\
**Last updated:** [June 8, 2016, 6:52am UTC](https://faq.inetsoftware.de/t/how-to-get-all-drawable-element/62 "2016-06-08T06:52:31Z")

</div>

For get the pdf information, it need an instance of com.inet.pdfc.model.Document For geting a specific page information use the method getPage(\<pageindex\>) Document document = resultModel.getComparisonParameters().getF…

---

## [How show the PDF's with change marks](https://faq.inetsoftware.de/t/how-show-the-pdfs-with-change-marks/61)

<div class="topic-metadata">

**Author:** [@RichardRoedel](https://faq.inetsoftware.de/u/RichardRoedel)\
**Replies:** 0\
**Last updated:** [June 8, 2016, 6:14am UTC](https://faq.inetsoftware.de/t/how-show-the-pdfs-with-change-marks/61 "2016-06-08T06:14:04Z")

</div>

For show the PDF in the own GUI, it needed a instance of ResultPage. It get it with the getPage(\<pageindex\>, true) . The first parameter is the pageindex begin with a 0. The last parameter is true for the first pdf file …

---

## [How to get the total differences for two PDFs](https://faq.inetsoftware.de/t/how-to-get-the-total-differences-for-two-pdfs/46)

<div class="topic-metadata">

**Author:** [@KarstenHeinrich](https://faq.inetsoftware.de/u/KarstenHeinrich)\
**Replies:** 0\
**Last updated:** [June 2, 2016, 8:56am UTC](https://faq.inetsoftware.de/t/how-to-get-the-total-differences-for-two-pdfs/46 "2016-06-02T08:56:24Z")

</div>

Comparing two files with the i-net PDFC API is quite simple. Just create a PDFComparer instance, start the comparison and assign the result to a local variable. ResultModel result = new PDFComparer().compare( \<file1\>,…
