Inline Text Deep Link v1
https://www.pastetoprint.com/#text={percentEncodedUtf8Text}
- Encoding
encodeURIComponentsemantics- Portable URL size
- up to 8,000 characters
- Use for
- short, unstructured text
An AI client can return one clickable link containing short plain text or a compact PTDF document. No MCP call, POST request, server session or access to the user’s open browser tab is required.
Machine summary: /.well-known/ai.json
https://www.pastetoprint.com/#ptdf=…
Canonical contract
Finish the content first, encode it exactly once, return a clickable Markdown link and tell the user to review the preview.
https://www.pastetoprint.com/#text={percentEncodedUtf8Text}
encodeURIComponent semanticshttps://www.pastetoprint.com/#ptdf={unpaddedBase64UrlUtf8PtdfJson}
ptp.document/1Visibility boundary
The URL import feature and an AI client’s permission to inspect a browser tab are separate capabilities.
A fragment such as #ptdf=… is not part of the HTTP request. A remote retriever receives the page URL without the fragment and does not automatically receive the active tab’s DOM, editor state or address bar.
When the full URL is included in a chat message, the AI can read the fragment as ordinary text, decode it if capable and generate a new link from known content.
An AI may inspect the active address bar or page only when its client provides that capability and the user grants the required permission. A NoConsent result describes that client permission state—not the absence of URL import.
PasteToPrint does not send fragment content to a remote MCP call because URL import is intentionally handled by the browser. PasteToPrint MCP is a separate integration with its own document tools; it is not a general-purpose reader for the user’s open browser tab.
Deterministic example
Use real UTF-8 bytes, remove Base64 padding, verify the round trip and never guess an encoded payload.
function toBase64UrlUtf8(value) {
const bytes = new TextEncoder().encode(JSON.stringify(value));
let binary = "";
for (const byte of bytes) binary += String.fromCharCode(byte);
return btoa(binary)
.replace(/\+/g, "-")
.replace(/\//g, "_")
.replace(/=+$/g, "");
}
function fromBase64UrlUtf8(payload) {
const base64 = payload.replace(/-/g, "+").replace(/_/g, "/");
const padded = base64 + "=".repeat((4 - base64.length % 4) % 4);
const binary = atob(padded);
const bytes = Uint8Array.from(binary, char => char.charCodeAt(0));
return new TextDecoder().decode(bytes);
}
const document = {
schemaVersion: "ptp.document/1",
blocks: [{ type: "paragraph", text: "Hello" }]
};
const payload = toBase64UrlUtf8(document);
const source = JSON.stringify(document);
if (fromBase64UrlUtf8(payload) !== source) throw new Error("Round trip failed");
JSON.parse(fromBase64UrlUtf8(payload)); // Then validate against PTDF 1.0.
const url = `https://www.pastetoprint.com/#ptdf=${payload}`;
console.log(`[Open structured document in pasteToPrint](${url})`);
eyJzY2hlbWFWZXJzaW9uIjoicHRwLmRvY3VtZW50LzEiLCJibG9ja3MiOlt7InR5cGUiOiJwYXJhZ3JhcGgiLCJ0ZXh0IjoiSGVsbG8ifV19Handoff selection
URL import is the direct route for compact content. Larger documents have equally explicit alternatives.
/#text={encodedText}No tool call/#ptdf={base64urlJson}Deterministic byte encodingdocument.ptdf.jsonDownloadable file supportMCP or Document APIConfigured tool and user actionDirect answers
These answers are deliberately explicit so they can be retrieved, quoted and used without inspecting a live editor tab.
Yes. Use #text= for percent-encoded UTF-8 plain text or #ptdf= for unpadded RFC 4648 base64url-encoded UTF-8 PTDF 1.0 JSON.
No. URL import is an independent browser handoff. MCP and the Document API are optional routes for tool-connected agents and larger workflows.
By web standard, the fragment is processed client-side and is not included in the HTTP request. The retriever therefore receives no #text or #ptdf payload.
Yes. It only needs the document content and deterministic encoding. The fixed receiver prefix is https://www.pastetoprint.com/#ptdf= or https://www.pastetoprint.com/#text=.
No. The receiver shows a preview and requires the user to choose append, replace or cancel. Existing content is not silently overwritten.
Use #text= for short plain text, create a .ptdf.json file, or use MCP/API. A model must never guess a base64url payload.