Is it possible to store the source in the generated PDF?

I like the idea of the generated PDF being a self-contained thing. From it, we would be able to get the source .typ file used to generate it (along with maybe the typst version?) and modify it as we need and make a new PDF. I don’t have much knowledge of the PDF file format, but looking at Wikipedia, it seems that a stream object type might be able to store the compressed binary data of the .typ file.

Is such a thing possible? Is it a bad idea? Thoughts?

2 Likes

Embedding the source code is not currently possible. You can find the corresponding feature request on the issue tracker here. The Typst version, however, is already part of the PDF metadata.

1 Like

Thanks. I tried to see if anyone else had already created a relevant issue but I didn’t know how to articulate my search query.