Integrating Native Hyperlink Support into Scribus Text Engine(Right-Click → Insert Hyperlink)
1. Problem Statement
Currently in Scribus, hyperlinks in PDF documents are implemented as separate PDF Annotation objects that are manually positioned over text frames.
This creates several workflow limitations:
- Hyperlinks are not part of the text model.
- If text reflows, annotations must be manually repositioned.
- No "Insert Hyperlink" option exists in the text context menu.
- Managing many links (e.g., TOC, references, external URLs) is inefficient.
- Hyperlink styling cannot be directly tied to character styles.
In professional DTP workflows (books, magazines, technical documentation, hybrid print/digital PDFs), hyperlink support is expected to be integrated into the text engine, similar to:
- Adobe InDesign
- Affinity Publisher
- LibreOffice Draw/Writer
This proposal outlines a possible architectural approach to implement native hyperlink support in Scribus.
2. Architectural OverviewCurrent Model (Simplified)
Scribus currently separates:
- Text Engine (StoryText / text frames)
- PDF Annotation System
- PDF Export Layer
Hyperlinks exist only at the annotation level, not within text attributes.
3. Proposed Architectural EnhancementGoal:
Add hyperlink as a character-level text attribute, similar to:
4. Core Implementation Layers4.1 Text Engine LayerAdd a new character attribute:
struct HyperlinkAttribute {
enum LinkType {
ExternalURI,
InternalPage,
NamedDestination,
Email
};
LinkType type;
QString target;
};
This attribute should:
- Attach to character ranges
- Be stored inside StoryText
- Move and reflow with text
- Be serializable in the .sla format
4.2 UI LayerContext Menu
When text is selected:
- Right Click → Insert Hyperlink
If selection already contains hyperlink:
- Edit Hyperlink
- Remove Hyperlink
4.3 Hyperlink DialogMinimal dialog structure:
Fields:
Link Type:
External URL
Page
Named Destination
Email
Target (dynamic input depending on type)
Optional:
Checkbox: Apply "Hyperlink" character style
4.4 Styling System IntegrationHyperlinks should:
- Be compatible with Character Styles
- Allow a default "Hyperlink" style
- Not hard-code visual formatting
- Rendering should visually indicate hyperlink if styled accordingly.
4.5 PDF Export LayerDuring PDF export:
For each text frame:
- Iterate through character runs
- Detect HyperlinkAttribute ranges
- Compute bounding boxes for those ranges
- Automatically generate corresponding PDF Annotation objects
QuotePseudo-code:
for each textFrame in document:
for each textRun in textFrame:
if textRun.hasHyperlink():
rect = layoutEngine.calculateBoundingBox(textRun)
pdfExporter.createLinkAnnotation(rect, textRun.hyperlinkTarget)
Important:
- Must handle multi-line hyperlink ranges.
- Must handle text across frames (linked frames).
- Must respect rotated frames.
5. Backward Compatibility- Existing annotation workflow must remain functional.
- Old documents must load without change.
- New hyperlink attributes must not break SLA compatibility.
6. Optional Phase 2 Enhancements
- Auto-detect URLs in pasted text.
- Automatic TOC hyperlink generation.
- Hyperlink panel (list all hyperlinks in document).
- Convert annotation → text hyperlink tool.
- Named destination manager.
Benefits- Professional digital publishing workflow
- Reliable interactive PDFs
- Easier TOC and cross-reference creation
- Alignment with industry-standard DTP tools
- Stronger adoption for hybrid print/digital projects
ConclusionNative hyperlink support inside the text engine would significantly modernize Scribus' PDF workflow.
Even a minimal implementation (character attribute + export mapping) would dramatically improve usability and reduce manual annotation management.
This feature would elevate Scribus from "print-focused DTP with annotation workaround" to a fully capable hybrid publishing tool.
Would you mind, asking your AI to convert that pseudo code in a patch we can apply to Scribus?