PdfTextRedline
OfficeIMO.Pdf
Compares the text of two PDFs word by word and marks the differences on the new PDF with review annotations.
Inheritance
- object
- PdfTextRedline
Remarks
Words are read in reading order from every page, so edits are found across line and page breaks and reflowed text is not reported as changed. Insertions and replacements get highlights; deletions get a caret at the point where the text was removed. Replacements, deletions and moves carry the old text in their pop-up note. Page content is not changed. This compares extracted text only; use PdfVisualComparer for rendered appearance.
Methods
public static PdfTextRedlineResult Compare(byte[] oldPdf, byte[] newPdf, PdfTextRedlineOptions? options = null, CancellationToken cancellationToken = default) #Compares two PDFs and returns the annotated new PDF and the change list.
Parameters
- oldPdf byte[]
- Original PDF.
- newPdf byte[]
- Revised PDF; the annotations are added to a copy of it.
- options OfficeIMO.Pdf.PdfTextRedlineOptions? = null
- Comparison and annotation settings.
- cancellationToken System.Threading.CancellationToken = default
- Cancels the comparison.
Returns
PdfTextRedlineResultExceptions
ArgumentException– A PDF has no extractable text, for example a scan without a text layer.
public static PdfTextRedlineResult CompareFiles(string oldPath, string newPath, PdfTextRedlineOptions? options = null, CancellationToken cancellationToken = default) #Compares two PDF files and returns the annotated new PDF and the change list.
Parameters
- oldPath string
- newPath string
- options OfficeIMO.Pdf.PdfTextRedlineOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
PdfTextRedlineResult