Rich-text paste can carry far more than visible words
Clipboard HTML from office editors and websites can include fonts, sizes, dimensions, margins, layout rules and executable or remote-resource markup in addition to the visible document content.
A clean PDF editor should preserve useful document meaning without blindly inheriting every piece of source-page CSS.
1into1 sanitizes the pasted HTML first
The sanitizer allows document-oriented elements such as paragraphs, headings, lists, tables, blockquotes, preformatted text, horizontal rules and bounded embedded images.
It removes scripts, stylesheets, iframes, objects, embeds, metadata tags, SVG, MathML and other disallowed active or external structures.
Useful formatting survives while foreign layout CSS is normalized
The paste-normalization step keeps useful presentation properties such as text color, background color, font weight, font style, alignment and text decoration.
It deliberately removes pasted font-family, font-size, margins, dimensions, flex/layout properties and related presentation rules so the content follows the Text-to-PDF A4 typography instead of importing an entire foreign page layout.
Remote images are not fetched
Image elements are retained only when their source is an embedded data:image PNG, JPEG or WebP payload. Ordinary remote image URLs are removed rather than requested.
That makes pasted content more self-contained and avoids depending on external image servers during document creation.
Preview before export because the page model changes
A Word or webpage layout is not the same as a fixed A4 browser editor. After paste normalization, inspect headings, tables, lists, emphasis and page breaks in the preview.
The final export uses the normalized A4 preview as the visual source for the image-based PDF pages.
Official sources reviewed
- MDN — ClipboardEvent.clipboardDataDocuments access to clipboard data transferred during copy-and-paste events.
- MDN — HTML contenteditableExplains browser-editable HTML regions used for document editing and rich-text input.