Document the parameter list each destination type takes - #1785
Merged
blikblum merged 1 commit intoAug 28, 2026
Merged
Conversation
The page showed three worked examples of addNamedDestination() but never said what the parameter lists are, so the arity of each destination type had to be inferred from them — and six of the eight types appear nowhere on the page, so for those there was nothing to infer from. Sets out the eight types from ISO 32000-1 Table 151 with their positional parameters, which of them accept a null parameter, and what the zero-argument call produces. It also names the one conversion this method performs: an XYZ top is flipped against the page height, so it is given measured from the top of the page, while FitH, FitBH and FitR's vertical coordinates are written through unchanged and are measured from the bottom. The page's own two examples already differ on this and nothing said so.
4 tasks
Member
|
Many thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Documentation. This is the note you said yes to in #1783.
docs/destinations.mdshowed three worked calls but never stated the parameter lists, andsix of the eight destination types appear nowhere on the page — so for those there was
nothing to infer an arity from at all. The note adds the eight types from ISO 32000-1
Table 151 with their positional parameters, which of them accept
null, and what thezero-argument call produces.
It also names the one conversion the method performs, which is the part I think earns its
place: an
XYZtop is flipped against the page height, whileFitH,FitBHandFitR'svertical coordinates are written through unchanged. The page's own two examples already
disagree about the origin —
— and nothing said so, so a reader who carries the
XYZexample's convention into aFitHcall lands at the wrong end of the page.
Every arity and the
nullrule were checked against thepdfjs-distin this repo's devdependencies, and
FitR's parameter order against the way its viewer consumes them(
x = destArray[2],y = destArray[3],width = destArray[4] - x).One thing worth flagging rather than leaving you to find: the table will render as literal
pipes, because the docs are built with
markdown@0.5.0and the table dialect is notenabled.
docs/getting_started.mdanddocs/outline.mdalready ship that way through bothgenerators, so I matched the neighbours rather than making this page the odd one out — but
say the word and I'll convert it to a bullet list.
I'll close #1783 in favour of this.
Checklist:
Unreleasedsection carries behaviour changes