astro-typst icon indicating copy to clipboard operation
astro-typst copied to clipboard

Export to PDF Page

Open Myriad-Dreamin opened this issue 6 months ago • 3 comments

Astro actual makes it possible to render PDF pages. I hope astro-typst could support PDF builds (a new mode other than HTML/SVG):

https://github.com/Myriad-Dreamin/blog/blob/90db5688cac5d50db112692fea646361dd3fcd0c/src/pages/archive/%5B...slug%5D.pdf.ts

I can PR upon we reach consensus on API design.

Myriad-Dreamin avatar May 27 '25 17:05 Myriad-Dreamin

I think ?pdf is okay.

Also, if a ".typ?pdf" is imported in content, I think we should put it the result in assets and return an . But the user may want to adjust its sizes. Any thoughts?

Am Mi., 28. Mai 2025 um 01:40 Uhr schrieb Myriad-Dreamin @.***>:

Myriad-Dreamin created an issue (OverflowCat/astro-typst#15)

Astro actual makes it possible to render PDF pages. I hope astro-typst could support PDF builds (a new mode other than HTML/SVG):

https://github.com/Myriad-Dreamin/blog/blob/90db5688cac5d50db112692fea646361dd3fcd0c/src/pages/archive/%5B...slug%5D.pdf.ts

I can PR upon we reach consensus on API design.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

OverflowCat avatar May 27 '25 18:05 OverflowCat

Also, if a ".typ?pdf" is imported in content, I think we should put it the result in assets and return an . But the user may want to adjust its sizes. Any thoughts?

Does "sizes" mean PDF's page width? I think ?pdf will always render pdf with default settings, while we can allow passing sys.inputs to render pdf into different sizes. For example ?pdf&input=x-paper=a3 or ?pdf&input=x-paper=us-letter and a document being aware of it:

set page(paper: sys.inputs.x-paper)
= Title
Hello.

Myriad-Dreamin avatar Jul 10 '25 02:07 Myriad-Dreamin

This looks good to me. Also I think it is time to extractOpts as standard URLSearchParams.

Am Do., 10. Juli 2025 um 10:47 Uhr schrieb Myriad-Dreamin < @.***>:

Myriad-Dreamin left a comment (OverflowCat/astro-typst#15) https://github.com/OverflowCat/astro-typst/issues/15#issuecomment-3055140066

I think ?pdf is okay.

Also, if a ".typ?pdf" is imported in content, I think we should put it the result in assets and return an . But the user may want to adjust its sizes. Any thoughts?

Am Mi., 28. Mai 2025 um 01:40 Uhr schrieb Myriad-Dreamin @.***>: … <#m_6416343012394632212_>

Does "sizes" mean PDF's page width? I think ?pdf will always render pdf with default settings, while we can allow passing sys.inputs to render pdf into different sizes. For example ?pdf&input=x-paper=a3 or ?pdf&input=x-paper=us-letter and a document being aware of it:

set page(paper: sys.inputs.x-paper)= Title Hello.

— Reply to this email directly, view it on GitHub https://github.com/OverflowCat/astro-typst/issues/15#issuecomment-3055140066, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZ3LCQQYG5A2TBUBPJIC6L3HXH3RAVCNFSM6AAAAAB6AVVELCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTANJVGE2DAMBWGY . You are receiving this because you commented.Message ID: @.***>

OverflowCat avatar Jul 10 '25 04:07 OverflowCat