SharePoint PDF Page Citations
Sample topic that enhances the default citation behaviour for PDFs when using SharePoint as a knowledge source in Copilot Studio. When a generative answer cites a PDF stored in SharePoint and page markers are provided in the citations table, this topic rewrites the citation URL to include the specific page number (#page=N), so users are taken directly to the relevant page rather than just the document.
An optional variable is included to control whether Office files (Word, Excel, PowerPoint) are forced to open in the browser or in the desktop app. This gives makers flexibility to match their organisation’s preferred file-opening behaviour.
Features
- Page-specific PDF citations — appends
#page=Nto PDF links using page markers when they are returned in the citations held in System.Response.Citations. - Optional Office web-open control — a configurable variable that, when enabled, appends web=1 parameter to Office file links to open in the browser instead of the desktop app.
- Works with SharePoint knowledge sources and Generative Orchestration. When page markers are returned by SharePoint for PDFs in the System.Response.Citations table variable in Copilot Studio, the format for a page marker is different to the format used for Unstructured data as a knowledge source, for example uploaded files. For uploaded file scenarios, refer to citation-swap.
- Emits multiple citations for the pages a response was grounded on when the orchestrator returns multiple citations for chunks returned from a single PDF document. The page emitted in each citation uses the first page marker identified in each citation.
As of May 2026, in evaluations, GPT-5 Chat does not return multiple citations for a single file, while Claude Sonnet 4.6 does. That difference enables multiple page-specific citations for a document when several parts of the same PDF are used to ground a response.
Prerequisites
- A Copilot Studio agent with Generative Orchestration enabled.
- One or more SharePoint knowledge sources configured that contain PDF documents.
Instructions
- In your agent, ensure you have a SharePoint knowledge source configured, and that it contains PDFs.
- Create a new topic, switch to the Code editor view, and paste the contents of the YAML file below.
- Review the optional
openInBrowservariable — set it totrueif you want Office files to open in the browser instead of Office desktop apps. - Save the topic and test by asking a question that will cite a PDF document.
Files
| File | Description |
|---|---|
| sharepoint-pdf-citations.yml | Topic YAML for page-specific citations for PDFs when using SharePoint as a knowledge source — paste this into the Code editor for a new topic |
Limitations
- Page-specific linking only works for PDF files. Other file types will link to the document without a page anchor.
- The page metadata (
<page_#>) must be present in the citation text returned by the knowledge source; if it is missing, the link falls back to the document root. Page markers are sometimes not returned in citations for PDF files. This sample lets you use the page marker data when it is available. - Currently handles only the first page a chunk was returned from to ground the generative answers response. If several pages were used to ground the response, the citation emitted will point to the first page a chunk came from for the relevant PDF document.