using inetsoftware.Pdfc;
using inetsoftware.Pdfc.Presenter;
using System;
namespace inetsoftware.PdfcSamples
{
///
/// A sample for exporting the result of a comparison of 2 PDF Files to a PDF,
/// showing how to set the export path for this comparison report.
///
/// Expects 3 arguments: the paths of the 2 PDF files that will be compared,
/// and the path for the export file.If no export file exists,
/// a new file will be created.
///
/// See the CompareAndExportToSpecificFilename sample for an additional sample along these lines.
///
public class ReportingToSpecificFilename
{
static ReportingToSpecificFilename()
{
// Activate the license once from environment if required.
string key = Environment.GetEnvironmentVariable("PDFC_KEY");
if (!string.IsNullOrEmpty(key))
{
PDFC.ActivateLicense(key);
}
}
///
/// Start the sample, to show the reporting function of the result of comparison between 2 PDF files
///
/// Expects 3 arguments: the paths of the 2 PDF files that will be compared,
/// and the path for the export file. If no export file exists,
/// a new file will be created.
public static void Main(string[] args)
{
if (args == null || args.Length != 3)
{
throw new ArgumentException("Usage: ");
}
//Used the current i-net PDFC profile. If no profile has been previously set then the default profile will be used.
ReportPDFPresenter reportPDFPresenter = new ReportPDFPresenter(false, false, args[2]);
using (new PDFComparer()
.AddPresenter(reportPDFPresenter)
.Compare(args[0], args[1]))
{ }
}
}
}