XooCode(){

DigitalDocument

DigitalDocument describes a non-HTML document published on the web: a PDF whitepaper, a slide deck, a spreadsheet, a downloadable report. It is a CreativeWork subtype, not an Article subtype, because these documents are files rather than web pages. Use DigitalDocument when the content is a downloadable file that lives at a URL but is not meant to be read as a web page.

Google does not have a dedicated DigitalDocument rich result, but the markup helps Google understand what the file contains, who created it, and what license applies. This is especially useful for PDFs, which Google indexes but has limited ability to extract structured metadata from. The markup on the landing page gives Google the metadata it cannot reliably extract from the file itself.

Full example of schema.org/DigitalDocument json-ld markup

The markup is verified as valid with Rich Results Test from Google.

Highlight legend:Required by GoogleRecommendedOptional
schema.org/DigitalDocument
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@id": "https://xoocode.com/resources/roi-of-structured-data#document",
  "@type": "DigitalDocument",
  "name": "The ROI of Structured Data: 2026 Benchmark Report",
  "description": "Analysis of 1,200 websites that implemented schema markup in 2025, measuring changes in click-through rate, rich result impressions, and organic traffic. Includes methodology, raw data summary, and recommendations by industry vertical.",
  "url": "https://xoocode.com/resources/roi-of-structured-data",
  "datePublished": "2026-01-15",
  "dateModified": "2026-03-01",
  "inLanguage": "en-US",
  "author": {
    "@type": "Person",
    "name": "Lena Vasquez",
    "url": "https://xoocode.com/team/lena-vasquez",
    "jobTitle": "Head of Product",
    "worksFor": {
      "@id": "https://xoocode.com#organization"
    }
  },
  "publisher": {
    "@type": "Organization",
    "@id": "https://xoocode.com#organization",
    "name": "Xoo Code Inc."
  },
  "numberOfPages": 34,
  "encoding": {
    "@type": "MediaObject",
    "contentUrl": "https://xoocode.com/resources/roi-of-structured-data.pdf",
    "encodingFormat": "application/pdf",
    "contentSize": "2.8 MB"
  },
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "isAccessibleForFree": true,
  "hasDigitalDocumentPermission": {
    "@type": "DigitalDocumentPermission",
    "permissionType": "https://schema.org/ReadPermission",
    "grantee": {
      "@type": "Audience",
      "audienceType": "public"
    }
  },
  "keywords": "structured data, schema markup, ROI, SEO, rich results, benchmark",
  "about": {
    "@type": "Thing",
    "name": "Schema.org structured data",
    "sameAs": "https://en.wikipedia.org/wiki/Schema.org"
  }
}
</script>

hasDigitalDocumentPermission

hasDigitalDocumentPermission describes who can do what with the document. Each permission is a DigitalDocumentPermission with a permissionType (ReadPermission, WritePermission, CommentPermission) and a grantee (a Person, Organization, or Audience). This is how you express access control in structured data: "anyone can read this" or "only members can download this."

encoding with MediaObject

The encoding property links to a MediaObject describing the file itself: contentUrl (download link), encodingFormat (MIME type like application/pdf), contentSize (file size). This is similar to distribution on Dataset but for single documents rather than datasets. A document can have multiple encodings (PDF and DOCX versions).

DigitalDocument vs Article

Use Article (or its subtypes) for content published as HTML web pages. Use DigitalDocument for content published as downloadable files. The landing page for a PDF whitepaper should use DigitalDocument, even if the landing page itself is HTML. The markup describes the document, not the landing page. If the same content exists as both a web page and a PDF, mark up each version with the appropriate type.

Minimal valid version

The smallest markup that still produces a valid DigitalDocument entity. Use it as the floor. Reach for the advanced example above when you want search engines and AI agents to understand more about your content.

schema.org/DigitalDocument (minimal)
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "DigitalDocument",
  "name": "The ROI of Structured Data: 2026 Benchmark Report",
  "encoding": {
    "@type": "MediaObject",
    "contentUrl": "https://xoocode.com/resources/roi-of-structured-data.pdf",
    "encodingFormat": "application/pdf"
  }
}
</script>

Google rich results this unlocks

Markup matching this example makes your page eligible for the following Google Search rich results. The primary target drives the required / recommended property classification in the advanced code block above.

Common DigitalDocument mistakes

Mistakes that pass validation but silently fail to earn rich results or mislead consumers walking the graph. Avoid these and your markup will be ahead of most sites in the wild.

  1. 01

    Using Article for a PDF whitepaper

    Wrong
    "@type": "Article" on a landing page for a downloadable PDF
    Right
    "@type": "DigitalDocument" with an encoding pointing to the PDF

    Article is for HTML content meant to be read in a browser. DigitalDocument is for downloadable files. Using Article for a PDF landing page tells Google the page itself is the content, not the file. This confuses indexing and may result in Google showing the landing page instead of the PDF in results.

  2. 02

    Missing encoding for the actual file

    Wrong
    DigitalDocument with only url (the landing page) and no encoding
    Right
    "encoding": { "@type": "MediaObject", "contentUrl": "https://.../file.pdf", "encodingFormat": "application/pdf" }

    Without encoding, Google has no structured link to the actual file. The url property points to the landing page. The encoding property points to the downloadable file itself. Both are needed: url for the human-readable page, encoding for the machine-readable file link.

  3. 03

    encodingFormat as a file extension

    Wrong
    "encodingFormat": "pdf"
    Right
    "encodingFormat": "application/pdf"

    encodingFormat expects a MIME type. Common values: application/pdf, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet (Excel), application/vnd.openxmlformats-officedocument.presentationml.presentation (PowerPoint). File extensions are ambiguous.

  4. 04

    permissionType as a plain string

    Wrong
    "permissionType": "read"
    Right
    "permissionType": "https://schema.org/ReadPermission"

    permissionType expects a full schema.org URL. Valid values are ReadPermission, WritePermission, and CommentPermission. Plain strings are not standardized and may be ignored.

About the example data

The document is a fictional whitepaper by Xoo Code Inc. titled "The ROI of Structured Data," published as a downloadable PDF. The author is Lena Vasquez, the same head of product who wrote the BlogPosting about XooTee. The document is free to read, with permissions expressed through DigitalDocumentPermission.

Comments

Loading comments...

Leave a comment