MCPcopy Create free account
hub / github.com/LibPDF-js/core / alignmentToQuadding

Function alignmentToQuadding

src/api/pdf-form.ts:80–89  ·  view source on GitHub ↗

* Convert TextAlignment string to PDF quadding value.

(alignment: TextAlignment)

Source from the content-addressed store, hash-verified

78 * Convert TextAlignment string to PDF quadding value.
79 */
80function alignmentToQuadding(alignment: TextAlignment): number {
81 switch (alignment) {
82 case "left":
83 return 0;
84 case "center":
85 return 1;
86 case "right":
87 return 2;
88 }
89}
90
91/**
92 * Convert PDF quadding value to TextAlignment string.

Callers 1

createTextFieldMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected