Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Ability to export to: Plain text, PDF, ODT, HTML, DOCX, … #102

Closed

Description

@jancborchardt

Use-case: You write a collaborative document like the Nextcloud polishing issue. Then when you want to copy it into a Nextcloud issue, you notice that the Markdown characters like bullets, heading #, will all be stripped.

Since copying will copy the rich text, we can’t do "plain text copying" there.

We could have an "Export" entry in the toolbar where you can export it as "Plain text" or in the future even as HTML, or PDF if needed.

Activity

  1. added this to the 2.0 📋 milestone on Jun 25, 2019
  2. rkaraba commented on Jun 27, 2019

    @rkaraba

    Export to pdf would be great. Sometimes people need to print their notes.

  3. deleted a comment from stale on Aug 22, 2019
  4. modified the milestones: 2.0 📋 (Nextcloud 18), on Dec 6, 2019
  5. modified the milestones: , 19.0.0 on Jan 16, 2020
  6. changed the title [-]Copying from Text to other Markdown app strips markdown characters[/-] [+]Ability to export to: Plain text, PDF, ODT, HTML, DOCX, …[/+] on Sep 10, 2020
  7. 18 remaining items

  8. moved this to 🧭 Planning evaluation (don't pick) in 📝 Productivity teamon May 30, 2023
  9. moved this to 🧭 Planning evaluation / ideas in 🖍 Design teamon May 30, 2023
  10. Uatschitchun commented on Jul 11, 2023

    @Uatschitchun
  11. self-assigned this
    on Jul 12, 2023
  12. jancborchardt commented on Jul 14, 2023

    @jancborchardt
    MemberAuthor

    when you want to copy it into a Nextcloud issue, you notice that the Markdown characters like bullets, heading #, will all be stripped.

    @juliushaertl is it possible to prevent this and make sure that copying actually copies things, at least useful (and non-weird-looking) things like bullets (in form of "- ")?

  13. juliusknorr commented on Jul 14, 2023

    @juliusknorr
    Member

    is it possible to prevent this and make sure that copying actually copies things, at least useful (and non-weird-looking) things like bullets (in form of "- ")?

    You can already copy the plain markdown using Ctrl+Shift+C since #3941

  14. mmuman commented on Sep 3, 2023

    @mmuman

    I had another look and I found some simple enough js code to convert markdown from html that would fit my case, and the copy-paste from Text to the WordPress editor is much cleaner than that of Etherpad… The only problem now is the CORS policy preventing me to just download the file from the code. Guess I should open a ticket for that, no reason it should apply to download links.

    Still would be nice to get proper HTML export someday.

  15. juliusknorr commented on Jan 26, 2024

    @juliusknorr
    Member

    @blizzz Will unassign you from that one now as we haven't scheduled. Just in case you any notes worth sharing from your previous investigations, maybe you can dump them here for later reference.

  16. blizzz commented on Jan 26, 2024

    @blizzz
    Member
    That was the last state of my research notes (folded, because longcat)

    Text export

    Goals

    1. Markdown (rendered) to PDF
    2. Pluggable – apps my register converters
    3. Extensible – other formats can be converted from or to

    Characteristics

    1. Flexible – no hard requirements on the implementation of the converter tool
    2. via OCS-API
    3. via Capabilities
      • converters
      • types
    4. Registration per RegistrationContext
      • Perhaps split into Renderer and Converter
    5. sync (StreamResponse) and async (Push via Notification/files_notify/RPC, Pull via temporary URL)

    Thoughts

    • OOTB experience
      • native PHP PDF renderer shipped by default (with Text?) as fallback – with own parsing of Text and generation of the PHP document
      • native PHP PDF renderer via TipTap's $editor.getHTML() – bigger choice of libs. But, would only work in browser by providing the document content to convert. Not favoring this at all.
    • Consider to split into Renderer and Converter
      • rendering might be necessary to prepare a document (fetch previews etc.)
      • rendering most likely needs to be a step of a series. Perhaps app need to register their mime types. Markdown flavors may play a role.
    • Over all conversion steps (preliminary):
      1. get "raw" document
      2. fetch previews
      3. fetch other NC specific things (here be dragons)
      4. prepare temporary final document for conversion
      5. run converter
    • Flow:
      • client requests conversion via OCS API, in async or sync fashion
      • In sync fashion, connection stays/is kept open until conversion is completed, resulting in the final download link. Optional, nice to have, but not the recommended or desired option.
      • In async fashion, connection returns an process identifier. Push will notify clients (does that work with web ui?), also a status endpoint will provide information, at least "in progress", "download url", "expired/not found
      • RPC/Webhooks can be considered, too
    • ⚠️ Keep UX with big files in mind! Avoid timeouts, inform about progress, handle error cases.
    • 💡 Export whole Collective to a single PDF
      • actually already exists as feature via print preview
      • print to PDF could be an alternative via browser 🤔

    Development Phases

    1. Framework
      • Registration
      • Capabilities
      • Events?
      • Documentation
    2. Converter Reference Implementation
      • OOTB experience.
    3. Client usage
      • Expose in Web UI

    Questions

    • Order of multiple exporters for a requested type?
      • Hardcoded weight? Optional override for clients? Check with direct editing.
        • Direct editing takes the first best one
    • Conversion options might need to be passed on. What's the best way to provide and transport them?
    • How to render content that is not just a preview image? Even enriched images. How big is the issue?
      • In the document, only URLs are being stored, without more meta data
      • UX: In Text I do not see an option to add a speaking text to the link (even normally inserted)…
      • …but it works when it comes from proper markdown
      • Smart Pickers seem to have ReferenceProviders and references can (potentially) be matched against them. A Reference object is returned (or null). It contains meta data for non-vue rendering as well as an object dedicated to Vue.
      • Smart Pickers do only render standalone (including item of a list)! A picker embedded in text is not rendered in the web ui.
      • => Options
        • Leave links as it is
        • Turn link into markdown image (if present), use title as alt text if present. Maybe even have description (if present) following as another paragraph? Style…italique? quote?
        • Turn whole document into HTML and format using all possible fields
      • Callouts are custom?! (Neither Okular nor Ghostwriter render them at least)
        • Tables apparently not standard
        • Tasks apparently not standard
    • Where will converted files be stored? And how long will they live?
      • Ask design team, cf. OnlyOffice
      • keep in folder, but if write support (share)
    • Loading images with relative paths, how does it work?

    Side questions

    • Which related components do we actually use on Text fronted side?
    • TipTap does not actually support markdown? How do we deal with it?
    • How does an office document enriched by smart picker stuff look outside of Nextcloud, in LibreOffice?
      • Only links are inserted
      • Even without a speaking Link name 😞
      • Also profile picker does not show Avatar
      • No previews, no pictures

    Leads

    • ueberdosis/pandoc
      • PHP wrapper for pandoc
      • requires pandoc locally
      • used by pandoc Nextcloud app
    • Setasign/FPDF
      • native PHP PDF generator library
      • development process looks a bit shady
      • around a lot, recommended most often
    • Tecnickcom/tcpdf
      • native PHP PDF generator library
      • new version in rewrite… this code is… aged
      • often recommended though
    • gotenberg_php
      • wrapper for Gotenberg service
      • Gotenberg bundles Chromium and LibreOffice in a docker to offer document conversions via API
      • requires an external services. For docker, cannot be deployed with the app.
    • md2pdf
      • WIP
    • mdpf
      • converts HTML to pdf
      • could be an option when rendering from $editor.toHtmlexport…
      • …which cannot really be used on backend side. Big limitation.
    • pandoc / pandoc-bin
      • …itself
      • project offers static binaries for 64bit, both AMD/Intel and ARM, but not 32 bit (how big of an issue is that?)
    • pandoc app
      • currently not in our scope
    • use FFI to convert via a non-PHP library
      • could be a replacement for pandoc-bin and be shipped easily
    • y.js - could that be useful here, or totally out of place?
    • wasm-pandoc
      • seems unofficial without debug steps
      • frontend-only, too
  17. mejo- commented on Jul 26, 2025

    @mejo-
    Member

    With Nextcloud 31 and the pandoc app installed, you can save markdown files in many different formats including pdf and docx. With the richdocuments app, it's also to possible to save as odt.

    The option can be found in the file actions under "Save as ...".

    Attachments and images are not handled, but I guess that's something to be discussed in a new issue.

  18. moved this from 🧭 Planning evaluation (don't pick) to ☑️ Done in 📝 Productivity teamon Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions