Skip to content

PDF file attachments #2499

Closed
Closed

Description

@miliog

Description

I'd like to be able to create PDF attachments.

ed08 png img
(Screenshot from https://helpx.adobe.com/acrobat/using/links-attachments-pdfs.html#)

Use Case

It's very convenient to add file attachments to the PDF itself. Not only Acrobat Reader, but also many open source readers support it.

Activity

  1. added
    feature request
    on Oct 26, 2023
  2. changed the title [-]PDF attachments[/-] [+]PDF file attachments[/+] on Oct 26, 2023
  3. tingerrr commented on Oct 26, 2023

    @tingerrr
    Contributor

    This seems like a good-contribution, the relevant sections in the PDF 1.7 spec are 12.5.6.15 and 7.11.4, these features would have to be upstreamed into pdf-wirter before typst can support this.

  4. added
    pdf
    on Oct 26, 2023
  5. awehrfritz commented on Feb 8, 2024

    @awehrfritz

    ... these features would have to be upstreamed into pdf-wirter before typst can support this.

    As far as I can tell, pdf-writer has support for this already: typst/pdf-writer@ba040ac

  6. NiklasEi commented on Oct 15, 2024

    @NiklasEi
    SponsorContributor

    An early attempt at implementing file attachments associated with the document as a whole: https://github.com/NiklasEi/typst/tree/file-embedding

    There are many workarounds and how I implemented this is surely not the intended way. I would be glad for any constructive feedback 🙂

    The document

    Testing file embedding
    
    #embed("factur-x.xml")

    renders to this PDF with a dummy "factur-x.xml" file with typst compile embed.typ --pdf-standard a-3b (see the mini Typst project in the tests directory). The file is a valid PDF/A-3 according to an online PDF/A validator and my document viewer can find and download the attachment.

  7. laurmaedje commented on Jan 8, 2025

    @laurmaedje
    Member

    #5221 adds support for file embedding associated with the whole document, so I'll close this as resolved! There is still the separate feature of file attachments associated with specific parts of the document, but those can have their own issue. I won't open an issue right away, but if someone has a use case for that, feel free to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestpdf

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions