Namespace PDiffy
Classes
- DocumentChange
One difference between two documents or snapshots. Path locates it, such as "structure > Document > Table > TR[2] > TD[1]", or "line 12" in text without PDiffy's sections; Detail says what changed. SectionName names the section it's in, and PdfSection or DocxSection gives that section as an enum.
- DocumentDiff
The differences between two documents or two snapshots. PDF and Word documents and their snapshots are matched element by element, so an edited paragraph is one change instead of a removed line and an added one, and an element that moved is reported as moved. Any other text, such as a JSON snapshot, is compared line by line.
- DocxAlignments
The values of Alignment.
- DocxBetween
A DocxBookmarkBlock or DocxUnsupportedBlock between a table's rows or a row's cells. Before is the index of the row or cell that comes after it, or the count when it comes last.
- DocxBlock
Something in the body, a table cell, a header or footer, a note or a text box: a paragraph, a table, a content control, an inserted document, a bookmark between them, or content PDiffy can't read.
- DocxBookmark
A named place in the document that links and cross-references can point to. A bookmark in a table can cover only some columns: FirstColumn and LastColumn are then the first and last, counting from 0.
- DocxBookmarkBlock
A bookmark between paragraphs, tables, rows or cells, such as one that starts at a table; links can point to it.
- DocxBorder
A border on one side of a paragraph, table or cell.
- DocxBreak
A page or column break.
- DocxBreakKinds
The values of Kind.
- DocxCell
A table cell. Span is how many grid columns it covers; Merge is "restart" for the top of cells merged down a column and "continue" for those below it; Shading is its fill color in hex. Width, margins and borders are written as for DocxTable.
- DocxCellMerges
The values of Merge.
- DocxCellVerticalAligns
The values of VerticalAlign.
- DocxCheckFinding
Something a DocxCheck found: where it is and what's wrong. The path is the one a snapshot diff shows for the item's line, such as "body > Table > Row[2] > Cell > P > image", or "document" for the whole document.
- DocxCheckSet
A set of DocxCheck rules for Check(DocxCheckSet). Latest grows as PDiffy adds rules, so an upgrade can fail a test that passed; a release's own set, such as Version1_0, never changes, so upgrading adds no rules until a test moves to a newer set.
- DocxCommentReference
Where a comment is attached. Notes has what the comment says.
- DocxControl
A content control around paragraphs or tables, such as a repeating section or a rich-text box.
- DocxDocument
Everything PDiffy reads from a Word document (DOCX), in the order a snapshot prints it.
- DocxDocumentInfo
Document-wide details: the file's properties, language, compatibility and protection settings.
- DocxField
A field: its code, such as "PAGE" or "TOC \o "1-3"", and its result, the text Word last showed for it. The result is also part of the paragraph's text, unless the field is nested in another field's code; then the outer code shows the field's own code in braces instead.
- DocxForm
A form control in the text: a content control or a legacy form field, as its Kind says. Name is a content control's tag or a legacy field's name; a check box's Value is "yes" or "no".
- DocxGraphicKinds
The values of Kind. A drawing of a kind not listed here is named after the last part of the graphic's type, such as "chartex".
- DocxHeaderFooter
A section's header or footer of one kind: "default", "first" or "even". Blocks is null when its part can't be found.
- DocxHighlights
The values of Highlight.
- DocxImage
An image or other graphic. Width and height are in points. For a picture, Hash is the first 16 hex digits of the image's SHA-256, which catches a swapped image, and Type its file type, such as "png". For an embedded object, Type is the program it belongs to, such as "Excel.Sheet.12", and Hash is of what it holds; for an ActiveX control, Type is the control's name.
- DocxInline
Something in a paragraph's text. Position is where, counted in characters of its text.
- DocxInserted
A document inserted into this one (w:altChunk). A DOCX is read in place into Document, with its own styles and lists; other formats, such as HTML or RTF, and a DOCX that can't be opened (Unreadable) are recorded by Hash, which is null when the inserted file is missing.
- DocxLineSpacing
A paragraph's line spacing.
- DocxLink
A link: the text it covers and where it goes, a URL or "#bookmark" for a place in the document.
- DocxList
A list the document uses: its id, the definition it numbers from (w:abstractNumId, or the definition of the list style it links to) and the levels used.
- DocxListItem
A paragraph's place in a list: the list's id (w:numId), its level from 0, and the label Word shows, such as "A." or "1.2", counted from the items before it. The label is null when the list or its level isn't defined.
- DocxListLevel
How one level of a list is numbered: its format (such as "decimal", "upperLetter" or "bullet"), its label pattern (such as "%1." or a bullet character), the number it starts at, its indents in points and its bullet font. Format, Text and Start are null when the list's definition has no such level.
- DocxMargin
The space on one side between a cell's edge and its text.
- DocxMath
An equation: the characters of its text in order, such as "x=a+b", and a hash of how it's built, which changes when, for example, a fraction becomes a division even though the characters stay the same.
- DocxNote
A footnote, endnote or comment: its kind, id, a comment's author and what it says.
- DocxNoteReference
Where a footnote or endnote is referenced. Notes has what the note says.
- DocxPageSetup
One section's page geometry. Lengths are in points.
- DocxParagraph
A paragraph: its style, list item, layout, text and what sits in the text.
- DocxParagraphFormat
How a paragraph is laid out. Lengths are in points; null means not set.
- DocxProperty
A custom property in a Word document's file properties: its name and its value as text.
- DocxProtections
The values of Protection.
- DocxRevision
A tracked change and who made it. An insertion, deletion, move or run format change covers text; the paragraph kinds are about the paragraph itself, with no text; table, row and cell kinds are on Revisions, Revisions and Revisions, and SectionFormat on Revision. Tables, rows, cells and sections have no text and no position.
- DocxRow
A table row. A header row repeats at the top of each page the table runs onto.
- DocxRowHeight
A table row's height.
- DocxRunFormat
How text looks. Sizes are in points; null means not set.
- DocxRunVerticalAligns
The values of VerticalAlign.
- DocxSectionBreaks
The values of Break.
- DocxSnapshotOptions
What to leave out of a DOCX snapshot, or change in it, for content a test doesn't care about. Ignored sections still print their header with "(ignored)" under it, and the snapshot's first lines list what was ignored.
- DocxSpan
Part of a paragraph's text and how it looks.
- DocxStrayText
The text, tabs and breaks of a run where WordprocessingML doesn't allow one: inside the paragraph's properties (w:pPr). Word may drop or move it, so it isn't part of the paragraph's text, but it's recorded so the text isn't lost and the problem shows. Its Position is always 0, before the paragraph's text.
- DocxStyle
A style the document uses. RunFormat and ParagraphFormat are resolved through its based-on chain.
- DocxStyleTypes
The values of Type.
- DocxSymbol
A character from a symbol font, such as Wingdings: the font and the character's code in hex.
- DocxTabStop
A custom tab stop.
- DocxTable
A table: its grid, rows and cells, and the widths, margins and borders it sets.
- DocxTextDirections
The values of TextDirection.
- DocxUnderlines
The values of Underline.
- DocxUnreadablePart
A part of the file that couldn't be read, and a hash of its bytes, so a change to it still shows.
- DocxUnsupported
Something in a paragraph PDiffy doesn't read yet, such as a phonetic guide (w:ruby): the element's name and a hash of its contents, so a change to it still shows.
- DocxUnsupportedBlock
Something between paragraphs, tables, rows or cells that PDiffy doesn't read yet: the element's name and a hash of its contents, so a change to it still shows.
- DocxWidth
The width of a table or cell.
- FileSnapshotOptions
Where VerifyFile(string, Action<FileSnapshotOptions>?, string, string) keeps a file's snapshot. The snapshot itself uses the suite's default options for the file's kind.
- PdfAction
An action the document runs, such as going to a page or opening a web address. Type is null when the PDF gives only a destination to go to, with no action.
- PdfAnnotation
An annotation: a link, comment, form widget and so on. Its rectangle is in points from the page's bottom-left corner. Role is Tagged when a structure element points to it.
- PdfAnnotationTypes
The standard values of Subtype.
- PdfArtifactSubtypes
The standard values of Subtype.
- PdfArtifactTypes
The standard values of Type.
- PdfBookmark
A bookmark. Page is set when it goes to a page of this document, Uri when it opens a web address and File when it opens another file.
- PdfBorder
An annotation's border: its style and its width in points.
- PdfBorderStyles
The values of Style.
- PdfBox
A rectangle in points from the page's bottom-left corner.
- PdfCheckFinding
Something a PdfCheck found: where it is, its page when it has one, and what's wrong. The path names the snapshot section and the item: for a structure element, the path a snapshot diff shows, such as "structure > Document > Figure[2]".
- PdfCheckSet
A set of PdfCheck rules for Check(PdfCheckSet). Latest grows as PDiffy adds rules, so an upgrade can fail a test that passed; a release's own set, such as Version1_0, never changes, so upgrading adds no rules until a test moves to a newer set.
- PdfDeclaration
A standard or specification a PDF declares it conforms to, in its XMP (pdfd:declarations).
- PdfDestination
Where a link, bookmark or action goes: a page, the view a viewer opens it at (a PDF view type such as XYZ, Fit or FitH) and that view's positions in points, with null for a position the viewer keeps as it is. Name is set, and the rest empty, when the PDF names a destination it doesn't define.
- PdfDestinationViews
The standard values of View.
- PdfDocumentInfo
What the PDF's catalog says about the document as a whole, and its page count.
- PdfEmbeddedFile
A file attached to the document, in its list of attachments or through a FileAttachment annotation on a page. Hash is the first 16 hex digits of a SHA-256 of its contents. Unreadable is set when the contents are damaged.
- PdfFileRelationships
The standard values of Relationship.
- PdfFont
A font. UnmappedCodes lists the character codes its text uses that don't map to Unicode: that text can't be copied, searched or read aloud correctly.
- PdfFontTypes
The standard values of Subtype.
- PdfFormField
A form field. Name is the full name, parent names joined with dots (address.city). AccessibleName is what a screen reader announces for it.
- PdfFormScript
A script on a form field: when it runs, and a hash of its JavaScript, so any edit to it shows. The hash is null when the script's stream is damaged and can't be read.
- PdfFormSettings
Settings that apply to a whole form rather than to one field.
- PdfHeading
A heading in the structure tree. Level is 1 to 6, or null for a plain H.
- PdfImage
An image. Hash comes from the decoded pixels where they can be decoded, so changing only how the image is compressed doesn't change it.
- PdfLayer
An optional-content layer and whether a viewer shows it when the file opens.
- PdfLayerConfiguration
An optional-content configuration: which layers a viewer shows, under a name it lists.
- PdfListNumberings
The standard values of ListNumbering.
- PdfMarkedSpan
What marked content inside a structure element says about its own text: its language, replacement text, alt text or expansion, which a screen reader uses instead of the element's.
- PdfMediaClip
A media clip, such as a video, that a Screen annotation plays.
- PdfMetadata
Document metadata from the Info dictionary and XMP. CustomProperties holds every Info entry not covered by the other properties, such as a company name or a classification label.
- PdfNamespaces
The namespaces a PDF 2.0 structure element's type can be in (Namespace). An element with no namespace uses PDF 1.7's types; any other namespace, such as a generator's own, has its types role-mapped.
- PdfPage
A page. Unreadable is set when the PDF library could not load it; its other values are then empty. The boxes are set only when the page declares them (or, for the crop box, inherits one).
- PdfPageGroup
A page group: its type (usually "Transparency"), the color space it blends in, and its isolated and knockout options.
- PdfPageLabelRange
A range of page labels, such as roman numerals for the front pages, from FirstPage until the next range starts.
- PdfPageLabelStyles
The standard values of Style.
- PdfPageLayouts
The standard values of PageLayout.
- PdfPageModes
The standard values of PageMode.
- PdfPageText
Text on a page that no structure element holds: an artifact or untagged text. An artifact can say what kind it is, in Type (Pagination, Layout, Page or Background) and Subtype (such as Header or Footer).
- PdfProperty
A named value, as the PDF stores it.
- PdfRoleMapping
One role map entry: a custom structure type and the type it maps to.
- PdfSettings
Document-wide settings that change how a viewer opens, shows or restricts the file.
- PdfShading
A shading painted on its own with the sh operator: a gradient or mesh of colors that fills the clipping area without a path. A shading used as a path's fill shows in Fill instead.
- PdfSignature
What a signature field's signature records, without checking it. The signature's bytes and signing time are left out, since they change every time a file is signed.
- PdfSnapshotOptions
What to leave out of a snapshot, or change in it, for content a test doesn't care about. Ignored sections still print their header with "(ignored)" under it, and the snapshot's first lines list what was ignored and which pages were kept.
- PdfStructureElement
A structure element. Name replaces the type in the snapshot when other elements refer to it (TH1, TH2).
- PdfStructureTypes
The standard structure element types, for use with Elements(string). Custom types that a PDF role-maps to one of these are matched too. PDF 1.7 and PDF 2.0 share most of them; the ones only PDF 2.0 has are in its namespace (Pdf2), and Art, BlockQuote, TOC, TOCI, Index, Private, Quote, Note, Reference, BibEntry and Code are only PDF 1.7's.
- PdfTabOrders
The standard values of Tabs.
- PdfTableScopes
The standard values of Scope.
- PdfTextRun
Text on one line that shares a font, size, color, render mode and role. Positions are in points from the page's bottom-left corner.
- PdfUaDocument
Everything PDiffy reads from a PDF, in the order a snapshot prints it.
- PdfVectorPath
A painted vector path: its bounding box, and its fill and stroke. Unpainted parts are null.
- RemediationDiff
What changed between a PDF and its remediated version: the changes to its content, which a remediation isn't expected to make, and every change. It doesn't say whether the remediation is right. For that, compare the checks sections (Check(PdfCheckSet)) and have an accessibility specialist review the tags.
- Snapshot
Snapshot tests for PDFs, Word documents, text and JSON:
VerifyPdfAsync,VerifyDocxAsync,VerifyTextAsyncandVerifyJsonAsync. The approved snapshot lives in{name}.verified.{extension}, and a mismatch writes{name}.received.{extension}and an HTML report, then throws SnapshotException, so it works with any test framework. The settings here apply to every kind.
- SnapshotCall
A snapshot call, for Location: who made it and what it asked for.
- SnapshotException
Thrown when a snapshot check fails: the snapshot differs, its folder can't be found, or JSON can't be read. The message says why.
- SnapshotLocation
Where a snapshot's files go: the folder and the name each file starts with.
- StructureMatch
The result of MatchStructure(string): whether the structure tree matches the template and, if not, the closest part of the tree and the first template line it doesn't match.
- TextSnapshotOptions
What to change in a text or JSON snapshot before it's compared, for values that differ on every run. Each scrub applies to the whole text.
Enums
- ChangeKind
What kind of difference a DocumentChange is.
- CheckSeverity
How much a PdfCheckFinding or a DocxCheckFinding matters.
- DocxCheck
A rule Check(params DocxCheck[]) can apply. Each one catches a mistake that generated Word documents often make and that keeps them from being accessible. These are fast regression checks, not a full accessibility review.
- DocxCheckCategory
The family a DocxCheck belongs to, so findings can be grouped by family.
- DocxDetail
A detail that Ignore(params DocxDetail[]) leaves out of a DOCX snapshot wherever it appears.
- DocxFormKind
The kind of a form control: a content control (DocxForm, DocxControl) or a legacy form field.
- DocxNoteKind
The kind of a DocxNote or DocxNoteReference.
- DocxProfile
A ready-made set of sections and details to leave out of a DOCX snapshot, named after what a test guards. Apply one with Use(DocxProfile). The snapshot's header lists what it leaves out, so a profile that leaves out more in a later release shows up as a changed snapshot rather than a test that quietly checks less.
- DocxRevisionKind
What a tracked change (DocxRevision) changed.
- DocxSection
The sections of a DOCX snapshot. New sections are added at the end of the enum, even when the snapshot prints them between existing ones, so existing members keep their values.
- DocxWidthUnit
The unit of a DocxWidth.
- PdfAnnotationFlags
How a viewer treats an annotation: whether it is shown, printed, editable and so on.
- PdfBlendMode
How content's colors mix with what's drawn under it, as PDF names its blend modes. Most content is Normal, which paints over what's under it.
- PdfCheck
A rule Check(params PdfCheck[]) can apply: the mistakes generated documents make that keep them from being accessible or tidy. These are fast regression checks, not a PDF/UA validator such as veraPDF or PAC.
- PdfCheckCategory
The family a PdfCheck belongs to, such as tables or fonts, so findings can be grouped by family; HouseRules holds the policies that aren't accessibility rules.
- PdfContentRole
How assistive technology treats a piece of page content.
- PdfDetail
A detail that Ignore(params PdfDetail[]) leaves out of the snapshot wherever it appears.
- PdfFontProblem
Something PDF/UA forbids in a Type 0 or TrueType font's dictionaries or CMaps, which FontDictionaries finds, or in a font's embedded TrueType, Type 1 or CFF program, which FontPrograms finds.
- PdfFormFieldAlignment
How text in a field lines up.
- PdfFormFieldFlags
Options set on a form field. Which ones apply depends on the PdfFormFieldType.
- PdfFormFieldType
What kind of control a form field is.
- PdfFormScriptTrigger
When a form field's script runs.
- PdfLineCap
How the ends of an outline are drawn. Most outlines use Butt.
- PdfLineJoin
How the corners of an outline are drawn. Most outlines use Miter.
- PdfParentTreeProblem
Something wrong with the keys of the parent tree, the number tree that maps each page's StructParents and each annotation's StructParent back to structure elements. A reader looks keys up assuming they're sorted and unique, so it can miss entries.
- PdfPermissions
What an encrypted document lets a reader do.
- PdfProfile
A ready-made set of sections and fields to leave out of a PDF snapshot, named after what a test guards. Apply one with Use(PdfProfile). The snapshot's header lists what it leaves out, so a profile that leaves out more in a later release shows up as a changed snapshot rather than a test that quietly checks less.
- PdfRenderingIntent
How a color outside what the output device can show is brought into what it can, as PDF names its rendering intents. Most content is RelativeColorimetric, PDF's default.
- PdfSection
The sections of a PDF snapshot. New sections are added at the end of the enum, even when the snapshot prints them between existing ones, so existing members keep their values.
- PdfSignatureCertification
What a certifying signature allows to change after signing without invalidating it.
- PdfTextRenderMode
How text is drawn. Most text is Fill; Invisible text (often an OCR layer) has no ink.
- PdfTolerance
The numbers in a PDF snapshot that Tolerate(PdfTolerance, double) can let differ a little.
- PdfXfaForm
What kind of XFA form a PDF carries.