Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Typst template file as bytes object #88

Closed
SaidStae opened this issue Mar 6, 2025 · 4 comments · Fixed by #89
Closed

Support Typst template file as bytes object #88

SaidStae opened this issue Mar 6, 2025 · 4 comments · Fixed by #89

Comments

@SaidStae
Copy link

SaidStae commented Mar 6, 2025

Hi,

Is there a possibility in the near future for support of using the typst template file as a bytes object instead of only as a pathlike input when compiling the pdf? I would really love to use typst inside of an api and sending the template file as an input in the body of the request. Thank you for your great work!

@messense
Copy link
Owner

messense commented Mar 6, 2025

Duplicate of #4

@messense messense marked this as a duplicate of #4 Mar 6, 2025
@messense messense closed this as completed Mar 6, 2025
@messense messense linked a pull request Mar 7, 2025 that will close this issue
@SaidStae
Copy link
Author

SaidStae commented Mar 7, 2025

Found a workaround usings pythons tempfile. Got an Azure function on a consumption plan working to generate pdfs by adding the typ template file as an input in the body and the variables as json in the header. Did have to change the font directory to the main directory during compile. Works great! Thanks for making it possible to finally be able to use an Azure function on a consumption plan to generate template based pdfs.

@messense
Copy link
Owner

messense commented Mar 7, 2025

Note that support for passing bytes was already added in v0.13.1.

@SaidStae
Copy link
Author

SaidStae commented Mar 7, 2025

Thanks! I was using 0.13.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants