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

Optional page range that needs to be printed #5

Closed
huysentruitw opened this issue Oct 12, 2020 · 0 comments
Closed

Optional page range that needs to be printed #5

huysentruitw opened this issue Oct 12, 2020 · 0 comments
Assignees

Comments

@huysentruitw
Copy link
Owner

huysentruitw commented Oct 12, 2020

It should be made possible to pass an optional page range to the print command, so we can specify which pages from the PDF needs to be printed.

Suggestion 1: Add FromPage and ToPage parameters
The API model for the print/from-pdf endpoint (https://github.com/huysentruitw/print-it#post-apiprintfrom-pdf) could be extended with 2 optional values:

  • FromPage (Optional value, ranging from 1 to the number of pages)
  • ToPage (Optional value, ranging from 1 to the number of pages)

When ToPage is not specified, but FromPage is, start from FromPage (inclusive) and print to the end.
When FromPage is not specified, but ToPage is, start from the beginning of the document and print until ToPage (inclusive).
When ToPage < FromPage, throw an error.

This suggestion is rather limited to a single range and doesn't allow complex ranges like you could pass to other print dialogs.

Suggestion 2: Add Pages parameter
The API model for the print/from-pdf endpoint (https://github.com/huysentruitw/print-it#post-apiprintfrom-pdf) could be extended with an optional Pages parameter.

The Pages parameter takes a comma-separated string that supports single pages as well as page ranges, examples:

  • 2 -> Only prints the 2nd page.
  • 2-4 -> Prints the 2nd page, until the 4th page.
  • 1,3-5 -> Prints the 1st page followed by the 3rd until the 5th page.
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

No branches or pull requests

1 participant