Welcome Guest Search | Active Topics | Sign In | Register

Determine whether a PDFDocument contains another PDFDocument Options
CMC
Posted: Tuesday, July 30, 2013 12:14:25 PM
Rank: Newbie
Groups: Member

Joined: 7/30/2013
Posts: 1
I have two PDF documents and I want to find out if each page of one PDF is contained in the other PDF. I tried using the C# code below but it is using a Reference Comparison for the Equals method, and I need a Value Comparison. I am not sure how to go about this.

protected Boolean ExistingPdfContainsNewPdf(PdfDocument existingPdf, PdfDocument newPdf)
{
Boolean pageFound = false;
foreach (PdfPage newPage in newPdf.Pages)
{
foreach (PdfPage existingPage in existingPdf.Pages)
{
if (newPage.Equals(existingPage))
{
pageFound = true;
break;
}
pageFound = false;
}
}
return pageFound;
}

Thank you very much.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.