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

[Feature Request] Export certain page range of document as pdf, png, etc #826

Open
ParaN3xus opened this issue Nov 15, 2024 · 2 comments · May be fixed by #1142
Open

[Feature Request] Export certain page range of document as pdf, png, etc #826

ParaN3xus opened this issue Nov 15, 2024 · 2 comments · May be fixed by #1142
Labels
enhancement New feature or request export Features about exporting documents

Comments

@ParaN3xus
Copy link
Collaborator

ParaN3xus commented Nov 15, 2024

Motivation

For example, we have a long document(homework of the whole lesson), but we only want to export a specific part(homework of a chapter) of its content.

Description
User can specify page range to export in exporting tasks.

Examples/Questions

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Export specific pages as PDF",
            "type": "typst",
            "command": "export",
            "export": {
                "format": "pdf",
                "page.range": "1..3", // or a list of pages to export
            }
        },
    ]
}

The argument and it's format is still open for disscussion.

@Myriad-Dreamin Myriad-Dreamin added the enhancement New feature or request label Nov 15, 2024
@Eric-Song-Nop
Copy link
Collaborator

I personally think this form of defining which parts to export the document might not be so handy as you think. To know which pages to export, you still need the full document being processed, and you need to change the page numbers continuously as the document grows. For me, using some Typst functions to define which parts of your document should be used might be more flexible.

@ParaN3xus
Copy link
Collaborator Author

To know which pages to export, you still need the full document being processed.

Yes, we are aware of this, because we will preview the entire document before exporting it. Actually this feature is simply to avoid the need to crop the desired pages again in other software after exporting the PDF.

You need to change the page numbers continuously as the document grows.

We can use flexible range formats like "5.." or "5..-2" to export pages as the document grows, especially if the growth is at the end of the document. For more complex cases, we could use headings as boundaries, manually inserted metadata, or as you mentioned, define a function.

@Myriad-Dreamin Myriad-Dreamin added the export Features about exporting documents label Nov 25, 2024
@Myriad-Dreamin Myriad-Dreamin linked a pull request Jan 9, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request export Features about exporting documents
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants