npm @embedpdf/core 3.5.0
Release v3.5.0

46 minutes ago

@embedpdf/viewer-chrome@3.5.0

Minor Changes

  • #1180 – Escape puts an armed stamp or signature away, and the tool goes back to the one from before. The viewer has a new command for it, annotation:disarm-stamp (label commands.annotate.disarmStamp, "Cancel stamp", in all fifteen languages), enabled only while a stamp is armed, and the shortcuts sheet lists it under Editing. Before, Escape did nothing while a stamp was armed.

  • #1174 – The form designer's sidebar has a Placeholder setting, next to the tooltip, for a text field, a dropdown, a signature field and an image field: the text the field shows while it is empty, in place of its purpose's label. What is typed is written without the white space at its ends, and an emptied input takes the placeholder away. The input stops at the most characters a placeholder takes, 256: typing stops there, and a longer paste is cut to it. Its label, form.settings.placeholder, is translated in all fifteen languages.

  • #1190 – The form designer's sidebar repeats the selected field on more pages. Under On more pages it has From page and To page, which start at the whole document, and Repeat on these pages: a field with a value gets one more box on each page, all of the same field, and an image field such as initials becomes a new field on each page. Each copy stands at the same place on its page, and all of them are one step to undo. A line under the button says which pages the field is on now, or that it couldn't be done. The section doesn't show for a signature field, for a document of one page, or without the right to design the form. Its seven labels, formDesign.repeatTitle, repeatFrom, repeatTo, repeat, repeated, repeatTooMany and repeatFailed, are translated in all fifteen languages.

Patch Changes

  • #1167 – The form designer's sidebar shows the settings it showed: a field's new purpose and format settings are left out of it for now. Their labels, form.settings.purpose and form.settings.format, are translated in all fifteen languages.

    The day of signing's hint, form.hints.date-signed ("Filled in when you sign"), is in every language the viewer has.

    The sidebar leaves a field's new assignment setting out too, and keeps showing its group; the setting's label, form.settings.assignment, and what a field anyone fills in reads as after its name, form.anyone, are in every language the viewer has.

    What an empty field shows for its purpose (form.purposes.name and the six others) is in every language the viewer has too, and so are the labels of the eight field tools the viewer has no command of its own for (commands.tool.signer-signature, signer-initials, signer-date-signed, signer-name, signer-email, signer-organization, signer-organization-title, form-image): what a button an app adds for one is called.

  • #1183 – The Form design switch follows the form plugin's isDesigning(), where it knew seven tool ids. Under any other field tool, such as form-image or a tool of your own, it read off while the form was being designed, a press on it switched design on again where it should end it, and picking a field in the design sidebar dropped the tool for form-edit. A user who may not design no longer sees the switch on under form-edit.

    isFormDesignTool() of @embedpdf/viewer-chrome/commands is deprecated: it knows those ids only. Ask form.isDesigning(), or isDesigningForm() in a command.

@embedpdf/angular@3.5.0

Minor Changes

  • #1175 – Every method a docs page's Methods table lists is on its Angular service. Twenty were missing, though React, Vue and Svelte had them:

    • EpdfForm: getFieldSettings(), addWidget(), updateWidget(), setButtonImage().
    • EpdfCommands: getRefusal(), disableCommand(), enableCommand(), setDisabledCommands(), getDisabledCommands(), isCommandDisabled().
    • EpdfRender: canRenderThumbnail(), handOverPictures(), getPicturePainter().
    • EpdfDocuments: identify(), declineIdentity().
    • EpdfAnnotation: isEditable().
    • EpdfInteraction: canUseTool().
    • The Stage (EpdfStage, EpdfStageRef): getCurrentDestination(), lockSettings(), getLock().

    Each has the plugin's own name and does what the plugin's method does. A read (get*, is*, can*) updates a template or a computed() that calls it, as the service's other reads do.

  • #1167 – <epdf-form-layer> shows what an empty field is for: the label of its purpose, in the fields.placeholder color, in a text box, a dropdown and a signature field, and on the field in design mode. A text box whose purpose is one of the web's names for a value (name, email, organization, organization-title) carries it as autocomplete. A field without a purpose is drawn as before. EpdfForm gains prefill() and listPurposes(), and @embedpdf/angular/form exports formatDate() and parseDate() for a date picker of your own.

    paints only the fields the user fills in: a box that isn't theirs (another person's field, a read-only one) gets no edge and no placeholder, and looks as the PDF has it. The day of signing gives the person whose date it is its hint as the box's tooltip and the control's aria-description. In design mode draws a lent field's outline, and a field tool's ghost carries the field's tint, outline and placeholder, see-through.

    paints a field anyone fills in in its own tint (fields.anyoneTintColor) and reads "Anyone" after its name; a box the fillable setting leaves out gets no tint. EpdfForm gains designAssignment() as a signal, and setDesignAssignment(), getDesignAssignment(), assign() and canAssign().

  • #1181 – The form layer says which fields are required. The control of a required field has aria-required: a text box, a checkbox, a dropdown and a list. A radio button has none: the state is a radio group's, and a group's buttons stand apart on the page with no element around them. A signature field's and an image field's control is a button, whose role has no such state, so it has none either. Once the form's fields.required setting gives a color, a required field of the user's that is still empty has its edge in it, until it holds something; --epdf-form-field-required wins over the color. With no color given, a field looks as it did. EpdfForm has validateValues().

  • #1183 – EpdfForm gains isDesigning() and the signal designing(): whether the form is being designed now.

  • #1190 – EpdfForm has repeat() and canRepeat(), the form plugin's new methods: a field shown at the same place on more pages as one step to undo, and whether a field can be repeated. canRepeat() is a read, so a template or a computed() that calls it updates.

  • #1169 – <epdf-form-layer> draws an image field's box (control: 'image'): with the signature plugin it is a button whose press makes the field the target, empty or filled, where the next mark goes in as its picture; it runs no script. Without the signature plugin the box is only its picture. An empty one shows its purpose, such as "Initials".

  • #1170 – <epdf-form-layer> shows its controls under any tool that neither fills nor designs the form, such as a stamp, a pen or zoom: the fields keep their tints, edges and placeholders, but the layer is inert, so they take no input and no pointer and the tool works over them. Before, the controls stood down under such a tool, so an empty field with no border of its own couldn't be seen while a mark was armed. Controls of the app's own do the same. The placeholder of a signature field and an image field is centred, where the mark and the picture go.

    <epdf-annotation-layer> draws a tool's preview, the armed stamp's preview and a drawing in progress above the form's fields, so a pen stroke or a mark over a field stays in sight, tint and all. Each <epdf-stage> and <epdf-page-view> page is its own stacking context now (isolation: isolate), so what a layer raises stays inside the page, under the next page and the Stage's overlays.

  • #1187 – EpdfSignature has finish() and canFinish(), the signature plugin's own: finish() seals a signer's part as their last step, and canFinish() says whether there is a field for them to sign. canFinish() updates a template or a computed() that calls it, as the service's other reads do.

Patch Changes

  • #1188 – Show the form's focus ring on a push button, an image field and a signature field while they hold the cursor. <epdf-form-layer> drew the ring, in the form's focus.color, for a text box, a checkbox, a radio button, a dropdown and a list only: after form.focus(), form.focusNext() or a press these three showed nothing, and after Tab they showed the browser's own outline. They now show the same ring as the other fields, however the cursor got there, and the browser's outline no longer shows on them. A control of your own is drawn as before: the layer adds no ring to it.

    A press on one of the three now puts the cursor in it in Safari too, which gives a pressed button no focus of its own: the field is then the form's focused field, it shows the ring, and form.focusNext() goes on from it, as in every other browser. That holds for a signed signature field a session may only inspect, and for the layer's own control inside a control of yours (native).

  • #1189 – The annotation layer shows the ghost of a tool with fixed stamp bytes (source: { kind: 'bytes', source }): the stamp's image at the pointer, as for an armed stamp. Before, nothing showed. The layer now loads the ghost's image from the ghost itself (getImageGhost(page).preview).

@embedpdf/react@3.5.0

Minor Changes

  • #1167 – <FormLayer> shows what an empty field is for: the label of its purpose, in the fields.placeholder color, in a text box, a dropdown and a signature field, and on the field in design mode. A text box whose purpose is one of the web's names for a value (name, email, organization, organization-title) carries it as autocomplete. A field without a purpose is drawn as before. @embedpdf/react/form also exports formatDate() and parseDate() for a date picker of your own.

    paints only the fields the user fills in: a box that isn't theirs (another person's field, a read-only one) gets no edge and no placeholder, and looks as the PDF has it. The day of signing gives the person whose date it is its hint as the box's tooltip and the control's aria-description. In design mode draws a lent field's outline, and a field tool's ghost carries the field's tint, outline and placeholder, see-through.

    paints a field anyone fills in in its own tint (fields.anyoneTintColor) and reads "Anyone" after its name; a box the fillable setting leaves out gets no tint. The form's state has designAssignment, who the next fields placed with a tool are for.

  • #1181 – The form layer says which fields are required. The control of a required field has aria-required: a text box, a checkbox, a dropdown and a list. A radio button has none: the state is a radio group's, and a group's buttons stand apart on the page with no element around them. A signature field's and an image field's control is a button, whose role has no such state, so it has none either. Once the form's fields.required setting gives a color, a required field of the user's that is still empty has its edge in it, until it holds something; --epdf-form-field-required wins over the color. With no color given, a field looks as it did.

  • #1169 – <FormLayer> draws an image field's box (control: 'image'): with the signature plugin it is a button whose press makes the field the target, empty or filled, where the next mark goes in as its picture; it runs no script. Without the signature plugin the box is only its picture. An empty one shows its purpose, such as "Initials".

  • #1170 – <FormLayer> shows its controls under any tool that neither fills nor designs the form, such as a stamp, a pen or zoom: the fields keep their tints, edges and placeholders, but the layer is inert, so they take no input and no pointer and the tool works over them. Before, the controls stood down under such a tool, so an empty field with no border of its own couldn't be seen while a mark was armed. Controls of the app's own do the same. The placeholder of a signature field and an image field is centred, where the mark and the picture go.

    <AnnotationLayer> draws a tool's preview, the armed stamp's preview and a drawing in progress above the form's fields, so a pen stroke or a mark over a field stays in sight, tint and all. Each <Stage> and <PageView> page is its own stacking context now (isolation: isolate), so what a layer raises stays inside the page, under the next page and the Stage's overlays.

Patch Changes

  • #1188 – Show the form's focus ring on a push button, an image field and a signature field while they hold the cursor. <FormLayer> drew the ring, in the form's focus.color, for a text box, a checkbox, a radio button, a dropdown and a list only: after form.focus(), form.focusNext() or a press these three showed nothing, and after Tab they showed the browser's own outline. They now show the same ring as the other fields, however the cursor got there, and the browser's outline no longer shows on them. A control of your own is drawn as before: the layer adds no ring to it.

    A press on one of the three now puts the cursor in it in Safari too, which gives a pressed button no focus of its own: the field is then the form's focused field, it shows the ring, and form.focusNext() goes on from it, as in every other browser. That holds for a signed signature field a session may only inspect, and for the layer's own control inside a control of yours (native).

  • #1189 – The annotation layer shows the ghost of a tool with fixed stamp bytes (source: { kind: 'bytes', source }): the stamp's image at the pointer, as for an armed stamp. Before, nothing showed. The layer now loads the ghost's image from the ghost itself (getImageGhost(page).preview).

@embedpdf/svelte@3.5.0

Minor Changes

  • #1167 – <FormLayer> shows what an empty field is for: the label of its purpose, in the fields.placeholder color, in a text box, a dropdown and a signature field, and on the field in design mode. A text box whose purpose is one of the web's names for a value (name, email, organization, organization-title) carries it as autocomplete. A field without a purpose is drawn as before. @embedpdf/svelte/form also exports formatDate() and parseDate() for a date picker of your own.

    paints only the fields the user fills in: a box that isn't theirs (another person's field, a read-only one) gets no edge and no placeholder, and looks as the PDF has it. The day of signing gives the person whose date it is its hint as the box's tooltip and the control's aria-description. In design mode draws a lent field's outline, and a field tool's ghost carries the field's tint, outline and placeholder, see-through.

    paints a field anyone fills in in its own tint (fields.anyoneTintColor) and reads "Anyone" after its name; a box the fillable setting leaves out gets no tint. The form's state has designAssignment, who the next fields placed with a tool are for.

  • #1181 – The form layer says which fields are required. The control of a required field has aria-required: a text box, a checkbox, a dropdown and a list. A radio button has none: the state is a radio group's, and a group's buttons stand apart on the page with no element around them. A signature field's and an image field's control is a button, whose role has no such state, so it has none either. Once the form's fields.required setting gives a color, a required field of the user's that is still empty has its edge in it, until it holds something; --epdf-form-field-required wins over the color. With no color given, a field looks as it did.

  • #1169 – <FormLayer> draws an image field's box (control: 'image'): with the signature plugin it is a button whose press makes the field the target, empty or filled, where the next mark goes in as its picture; it runs no script. Without the signature plugin the box is only its picture. An empty one shows its purpose, such as "Initials".

  • #1170 – <FormLayer> shows its controls under any tool that neither fills nor designs the form, such as a stamp, a pen or zoom: the fields keep their tints, edges and placeholders, but the layer is inert, so they take no input and no pointer and the tool works over them. Before, the controls stood down under such a tool, so an empty field with no border of its own couldn't be seen while a mark was armed. Controls of the app's own do the same. The placeholder of a signature field and an image field is centred, where the mark and the picture go.

    <AnnotationLayer> draws a tool's preview, the armed stamp's preview and a drawing in progress above the form's fields, so a pen stroke or a mark over a field stays in sight, tint and all. Each <Stage> and <PageView> page is its own stacking context now (isolation: isolate), so what a layer raises stays inside the page, under the next page and the Stage's overlays.

Patch Changes

  • #1188 – Show the form's focus ring on a push button, an image field and a signature field while they hold the cursor. <FormLayer> drew the ring, in the form's focus.color, for a text box, a checkbox, a radio button, a dropdown and a list only: after form.focus(), form.focusNext() or a press these three showed nothing, and after Tab they showed the browser's own outline. They now show the same ring as the other fields, however the cursor got there, and the browser's outline no longer shows on them. A control of your own is drawn as before: the layer adds no ring to it.

    A press on one of the three now puts the cursor in it in Safari too, which gives a pressed button no focus of its own: the field is then the form's focused field, it shows the ring, and form.focusNext() goes on from it, as in every other browser. That holds for a signed signature field a session may only inspect, and for the layer's own control inside a control of yours (native).

  • #1189 – The annotation layer shows the ghost of a tool with fixed stamp bytes (source: { kind: 'bytes', source }): the stamp's image at the pointer, as for an armed stamp. Before, nothing showed. The layer now loads the ghost's image from the ghost itself (getImageGhost(page).preview).

@embedpdf/vue@3.5.0

Minor Changes

  • #1167 – <FormLayer> shows what an empty field is for: the label of its purpose, in the fields.placeholder color, in a text box, a dropdown and a signature field, and on the field in design mode. A text box whose purpose is one of the web's names for a value (name, email, organization, organization-title) carries it as autocomplete. A field without a purpose is drawn as before. @embedpdf/vue/form also exports formatDate() and parseDate() for a date picker of your own.

    paints only the fields the user fills in: a box that isn't theirs (another person's field, a read-only one) gets no edge and no placeholder, and looks as the PDF has it. The day of signing gives the person whose date it is its hint as the box's tooltip and the control's aria-description. In design mode draws a lent field's outline, and a field tool's ghost carries the field's tint, outline and placeholder, see-through.

    paints a field anyone fills in in its own tint (fields.anyoneTintColor) and reads "Anyone" after its name; a box the fillable setting leaves out gets no tint. The form's state has designAssignment, who the next fields placed with a tool are for.

  • #1181 – The form layer says which fields are required. The control of a required field has aria-required: a text box, a checkbox, a dropdown and a list. A radio button has none: the state is a radio group's, and a group's buttons stand apart on the page with no element around them. A signature field's and an image field's control is a button, whose role has no such state, so it has none either. Once the form's fields.required setting gives a color, a required field of the user's that is still empty has its edge in it, until it holds something; --epdf-form-field-required wins over the color. With no color given, a field looks as it did.

  • #1169 – <FormLayer> draws an image field's box (control: 'image'): with the signature plugin it is a button whose press makes the field the target, empty or filled, where the next mark goes in as its picture; it runs no script. Without the signature plugin the box is only its picture. An empty one shows its purpose, such as "Initials".

  • #1170 – <FormLayer> shows its controls under any tool that neither fills nor designs the form, such as a stamp, a pen or zoom: the fields keep their tints, edges and placeholders, but the layer is inert, so they take no input and no pointer and the tool works over them. Before, the controls stood down under such a tool, so an empty field with no border of its own couldn't be seen while a mark was armed. Controls of the app's own do the same. The placeholder of a signature field and an image field is centred, where the mark and the picture go.

    <AnnotationLayer> draws a tool's preview, the armed stamp's preview and a drawing in progress above the form's fields, so a pen stroke or a mark over a field stays in sight, tint and all. Each <Stage> and <PageView> page is its own stacking context now (isolation: isolate), so what a layer raises stays inside the page, under the next page and the Stage's overlays.

Patch Changes

  • #1188 – Show the form's focus ring on a push button, an image field and a signature field while they hold the cursor. <FormLayer> drew the ring, in the form's focus.color, for a text box, a checkbox, a radio button, a dropdown and a list only: after form.focus(), form.focusNext() or a press these three showed nothing, and after Tab they showed the browser's own outline. They now show the same ring as the other fields, however the cursor got there, and the browser's outline no longer shows on them. A control of your own is drawn as before: the layer adds no ring to it.

    A press on one of the three now puts the cursor in it in Safari too, which gives a pressed button no focus of its own: the field is then the form's focused field, it shows the ring, and form.focusNext() goes on from it, as in every other browser. That holds for a signed signature field a session may only inspect, and for the layer's own control inside a control of yours (native).

  • #1189 – The annotation layer shows the ghost of a tool with fixed stamp bytes (source: { kind: 'bytes', source }): the stamp's image at the pointer, as for an armed stamp. Before, nothing showed. The layer now loads the ghost's image from the ghost itself (getImageGhost(page).preview).

@embedpdf/web@3.5.0

Minor Changes

  • #1167 – Add what the form layers share to show an empty field's purpose: fieldPlaceholderStyleOf() and recordPlaceholderStyleOf() for the placeholder's style, in the new --epdf-form-field-placeholder color, and autocompleteOf(), which gives a text box its autocomplete from the field's purpose (name, email, organization, organization-title). The placeholder sits on the same side of the screen as the field's value, on a right-to-left page too, and its words read in their own direction: a Hebrew label reads from the right on any page.

    A field in no group can show the form's fields.tintColor, which the new --epdf-form-field-tint-color wins over. widgetBoxStyleOf() takes a box's yours: a box that isn't the user's gets no edge, as the PDF has it. New: recordOutlineStyleOf() for a lent field's outline in fields.border, and ariaDescriptionOf() for a field's hint.

    A field anyone fills in shows the form's fields.anyoneTintColor, which the new --epdf-form-field-anyone-tint-color wins over. fieldTintOf() reads which setting an accent's color is the value of (setting) and lets that setting's variable win.

  • #1181 – The form layer's helpers draw the edge of a required field that is still empty, and say that a field is required. formColorsOf() reads the form's fields.required into colors.required (null while the setting gives no color), requiredEdgeOf(widget, colors) gives that color for a box that is the user's, required and empty, and widgetBoxStyleOf() and listBoxStyleOf() paint it: over the box's tint edge or its fields.border edge, and on a field with a border of its own too. ariaRequiredOf(required) is the aria-required attribute of a control, and toggleSaysRequired(toggle) says whether the control of a checkbox or a radio button has it: a checkbox does, a radio button doesn't, since the state is a radio group's. The theme has --epdf-form-field-required, which wins over the setting's color. FieldAsked is the new type for what a box says about being asked for. With no color given, every box is styled as it was.

  • #1188 – Add FORM_BUTTON_FILL, the style of the see-through button the form layer puts over a push button, a signature field and an image field. It fills the field's box and shows no outline of its own, so the browser's focus outline never shows on these fields: the layer draws its focus ring (formFocusRingStyleOf()) above them while they hold the cursor.

    Add bindPressFocus(), which puts the cursor in a field box's own control after a press by hand that left the cursor nowhere, or in an element around the box. Safari gives a pressed button no focus, so there a pressed push button, signature field or image field was not the form's focused field. It acts on a click the browser made for a press only: a click from a script, whatever click count it gives itself, and a click from the keyboard move no cursor, and a press that moved the cursor elsewhere keeps it there.

  • #1170 – fieldPlaceholderStyleOf() places the words where the form plugin says the value will be (placeholderAlign, falling back to the field's text alignment), and recordPlaceholderStyleOf() where a lent placeholder says (align, falling back to the record's alignment). A signature field's and an image field's placeholder are centred.

    previewZIndexOf(source) and PREVIEW_Z_INDEX say how a page layer stacks what isn't made yet: a tool's preview (ghost) and a drawing in progress (draft) rise above the layers after the annotation layer, the form's fields among them.

Patch Changes

  • #1187 – A form text box that someone typed in asks the form when it is left, also when its text reads as the field's value. Before, createTextFieldEditor took equal strings for "nothing was edited" and gave the edit up (discardDraftText()). That was wrong while something else was writing the box's text, such as a download or the signature plugin's finish() with the cursor still in the box: the form shows a text from the first step of its write, so the box read its own text back as the field's value. Leaving the box in that moment dropped the edit, the form then refused the text, and nothing remembered it: a signing after it signed the value the field had kept. The React, Vue, Svelte and Angular form layers use this editor, so the fix reaches all four.

    One thing changes for a box where the cursor is: text typed and then typed back to the field's value is written when the box is left, which runs the field's scripts and changes nothing, where before nothing was asked. A box nobody typed in still gives its edit up when it is left showing its field's value.

@embedpdf/engine@3.5.0

Minor Changes

  • #1163 – A form field's assignment says who fills it in: one group's signers, anyone, or no one in particular. doc.forms.create() and doc.forms.update() take it, every read returns field.assignment (a FieldAssignment, which this package exports), and doc.security.allowsField('fill', field) answers for it. Every signer may fill in a field anyone fills in, whatever group their permission names.

    await doc.forms.create({
      kind: 'text',
      name: 'delivery.date',
      assignment: { kind: 'anyone' },
      widgets,
    });
    await doc.forms.update(field.ref, {
      assignment: { kind: 'group', groupId: 'buyer' },
    });

    groupId stays: it reads the group's id (null for anyone and unassigned), and writing it works from any assignment, a group id for that group and null for unassigned. A write names one of the two: both, or anyone on a signature field, fail with InvalidArg. Giving a field to anyone takes fields:set-group:all. A signature without a lock of its own locks every field anyone fills in that holds a value at that signing, beside the rest of the signer's group; one still empty stays open for the next signer. A document in which no field is anyone's behaves as before.

  • #1168 – A form field says which signed signature locked it: field.lockedBy is { signatureIndex, source }, or null, whether or not the field is marked read-only. doc.security.allowsField('fill', field) now answers false for such a field, as a write fails with ProtectedDocument, and allowsField('sign', field) for a locked signature field, which can't be signed. Both follow a signing in the same session at once, also for a field read before it.

    Under signedDocumentPolicy: 'permit', a field still names its lock and allowsField('fill', field) answers true; a locked signature field still can't be signed, so allowsField('sign', field) stays false. An app that passed allowsField() the whole field gets the new answer; one that passed only { groupId } gets the old one.

  • #1173 – A form field holds a placeholder: the text its author wants shown while the field is empty, such as an example of what to type. doc.forms.create() and doc.forms.update() take placeholder, every read returns field.placeholder, and it stays with the field through a save, an undo, a copy and an import.

    const { field } = await doc.forms.create({
      kind: 'text',
      name: 'iban',
      placeholder: 'NL12 ABCD 0123 4567 89',
      widgets,
    });
    field.placeholder; // 'NL12 ABCD 0123 4567 89'
    await doc.forms.update(field.ref, { placeholder: null }); // none

    It is the author's text and never the field's value: a fill leaves it alone, and it is kept in the field's own private entry, not in the tooltip or the default value. It takes 1 to 256 characters in any language, with no white space at its start or end; anything else fails with InvalidArg. Every kind of field holds one, and setting it takes doc.forms.modify. The engine reads nothing into it: what shows it is up to your app, or to the viewer.

  • #1165 – doc.forms.setButtonImage(field, image | null) puts a PNG, a JPEG or a one-page PDF in every widget of a push button, or takes it out: an image field, as Acrobat makes one. A push button reads hasImage, and its widgets a layout ('caption', 'image', 'caption-below' and four more) that a create and updateWidget() write. It is filling in, one change with one undo step (the op forms.setButtonImage): a field anyone fills in takes any signer's image, and a signing locks it once it holds one. A field marked noExport exports without its image. A widget added later with addWidget() gets the field's image too, shown as its layout says. The change analysis counts the image as filling in, as Acrobat does: after an approval signature or a certification for form filling, analyze() reads it as permitted.

    A push button reads takesImage, whether it is an image field, which a person fills with a picture: every one of its widgets runs Acrobat's import-icon script (event.target.buttonImportIcon()) on a press, and nothing else. takesImage: true in create() or update() writes that script on each widget, so a click on the field in Acrobat asks for a picture, and false takes it off; neither takes doc.forms.script, and an action a widget's press already runs is never overwritten (InvalidArg). A button that only shows an image, a logo say, reads false. A widget added later, a copy and an import keep the fact.

    A picture shown in many places is stored once: a mark in ten signature fields now saves as one image, as ten stamps already did.

Patch Changes

  • #1162 – Fill in a field, or draw a mark into a signature field and sign it, after another signature, and that signature now stays valid in Acrobat and in analyze(). A fill records nobody now, so importValues() needs only what a fill needs, no longer doc.forms.import.

@cloudpdf/server@3.5.0

Minor Changes

  • #1163 – Who fills a form field in, as one assignment: a create (POST .../form/fields), an update (PATCH .../form/fields/{field}) and the forms.create and forms.update ops of a change take it beside groupId, and every field a response carries has it. Every token that may fill in some field fills in a field anyone fills in; giving a field to anyone takes fields:set-group:all. A signature without a lock of its own locks every such field that holds a value.

    The form's and the form export's engine values are raised, so answers with the new member get new URLs.

  • #1168 – Every form field a response carries says which signed signature locked it (lockedBy), or null.

    The form's and the form export's engine values are raised, so answers with the new member get new URLs.

  • #1173 – A form field holds a placeholder, the text its author wants shown while the field is empty: a create (POST .../form/fields), an update (PATCH .../form/fields/{field}) and the forms.create and forms.update ops of a change take placeholder, and every field a response carries has it, a form export's too. It takes 1 to 256 characters with no white space at its start or end, or null for none; anything else is refused with InvalidArg. Writing it takes doc.forms.modify.

    The form's and the form export's engine values are raised, so answers with the new member get new URLs.

  • #1190 – POST …/changes takes the new op forms.repeat: a form field shown at the same place on every page (pages: 'all') or on the pages named, as one more widget of the field or as a new field on each page. It is one op whatever the number of pages, so the limit of 512 ops in a change plays no part. It needs doc.forms.modify, and doc.forms.script to keep scripts, submits and links. A field the form doesn't have, or a page the document doesn't, refuses the change with NotFound, and a signature field with InvalidArg. A repeat stays within the server's bundleLimits: more pages than pages, or more widgets and fields than items, refuses its change with PayloadTooLarge. On the event stream, a client that says a version before 3.5 gets full-refresh in place of a change with this op.

  • #1165 – The change op forms.setButtonImage puts a push button's image in (its image part) or takes it out (null), and a widget's layout is read and written. The op forms.addWidget gives a push button's new widget the field's image. A push button reads takesImage, whether it is an image field, and a create and an update write it (POST and PATCH of a field, and the ops forms.create and forms.update): the server writes Acrobat's import-icon script on each widget's press with doc.forms.modify alone, and forms.addWidget gives an image field's new widget the script. The change analysis counts a push button's image as filling in, as Acrobat does. A mark in a signature field is stored once however many fields show it. The form and formExport engine values are raised: their answers carry hasImage, takesImage, layout, and a push button's image in a bundle.

Patch Changes

  • #1162 – Fill in a field, or draw a mark into a signature field and sign it, after another signature, and that signature now stays valid in Acrobat and in the analysis. A fill records nobody now, so a values import needs only what a fill needs, no longer doc.forms.import, and form reads give filledBy, filledByName and filledAt as null (cached form reads get new URLs).

@cloudpdf/contract@3.5.0

Minor Changes

  • #1163 – Who fills a form field in, as one assignment: a FieldAssignment component with kind as its discriminator, group (with its groupId), anyone or unassigned. FormField has it, and FormFieldDraft and FormFieldPatch take it beside groupId; the forms.create and forms.update ops of doc.changes carry it the same way. It arrives in 3.5: a server older than that refuses a draft or a patch that names it with InvalidArg, so a client sends such a server a group's or an unassigned field's as groupId, and a field anyone fills in only to a server that has it.

  • #1168 – A form field says which signed signature locked it: FormField.lockedBy is a FieldSignatureLock component (signatureIndex, and source: fieldmdp or lock), or null. It arrives in 3.5; an older server leaves it out.

  • #1173 – A form field's placeholder, the text its author wants shown while the field is empty: FormField has it, a string or null, and FormFieldDraft and FormFieldPatch take it, 1 to 256 characters; the forms.create and forms.update ops of doc.changes carry it the same way. It arrives in 3.5: a server older than that refuses a draft or a patch that names it with InvalidArg, so a client sends it only to a server that has it.

  • #1190 – The contract has the change op forms.repeat (field, pages, as, objectNumbers) and its result item (as, fields, widgets, dropped, calculationOrder, meta, and undone in an undo). openapi.json describes both.

  • #1191 – A checkbox and a radio group field have hasValuesList: whether the PDF names the widgets' values in a list in the field (/Opt). openapi.json describes it.

  • #1165 – A push button's image and a widget's layout.

    • WidgetAnnotation has layout: 'caption', 'image', 'caption-below', 'caption-above', 'caption-right', 'caption-left' or 'caption-over' for a push button's widget, null for any other. WidgetPlacement and WidgetPatch take it.
    • A push button's FormField has hasImage, and takesImage: whether it is an image field, which a person fills with a picture. A push button's FormFieldDraft and FormFieldPatch take takesImage.
    • doc.changes has the op forms.setButtonImage: { field, resources: { image } }, the image's part key (a PNG, a JPEG or a one-page PDF), or null to take it out. Its item is the field as it is now, with its widgets.
    • A form bundle's widget names a push button's image as its image resource.

    All of it arrives in 3.5. A server older than that refuses a placement or a patch that names layout, a draft or a patch that names takesImage, and the op forms.setButtonImage, so a client sends them only to a server that has them.

@cloudpdf/engine@3.5.0

Minor Changes

  • #1163 – A form field's assignment says who fills it in: one group's signers, anyone, or no one in particular. doc.forms.create(), doc.forms.update() and the forms.create and forms.update ops of doc.apply() take it beside groupId, every read returns field.assignment (a FieldAssignment, which this package exports), and doc.security.allowsField('fill', field) answers for a field anyone fills in.

    A server older than 3.5 knows only groupId: a group's or an unassigned field's assignment goes to it as that, in what an update expects too, and any other assignment goes as it is, for that server to refuse. A field anyone fills in is never sent to it: such a create, update or change fails with NotImplemented, and details.needs and details.serverVersion say which side to update. So does an import (doc.forms.import()) of a bundle with such a field, which an older server would make an unassigned one. Reading works against an older server: each field reads its assignment from its group, in an exported bundle too.

  • #1168 – A form field says which signed signature locked it: field.lockedBy is { signatureIndex, source }, or null. doc.security.allowsField('fill' | 'sign', field) answers false for a locked field, as the server refuses the write, and follows a signing at once. A server older than 3.5 names no lock: each of its fields reads lockedBy: null, in an exported bundle too.

  • #1173 – A form field's placeholder is the text its author wants shown while the field is empty. doc.forms.create(), doc.forms.update() and the forms.create and forms.update ops of doc.apply() take it, and every read returns field.placeholder, in an exported bundle too.

    A server older than 3.5 keeps no placeholder, so one is never sent to it: a create, an update or a change that names placeholder (null too, and in what an op expects) fails with NotImplemented before anything goes out, and details.needs and details.serverVersion say which side to update. So does an import (doc.forms.import()) of a bundle with a field that holds one, which an older server would make without it. Reading works against an older server: each field reads placeholder: null.

  • #1165 – doc.forms.setButtonImage(field, image | null) puts a PNG, a JPEG or a one-page PDF in every widget of a push button, or takes it out, and the image travels as a part of the change, as a stamp's does. A push button reads hasImage, and its widgets a layout that a create, addWidget() and updateWidget() write. It also reads takesImage, whether it is an image field, which a create and an update write: the server then writes Acrobat's import-icon script on each widget's press, with no doc.forms.script.

    They need a server of version 3.5. An older one is never sent them: setButtonImage(), the op forms.setButtonImage, a write that names a layout or takesImage (in a draft, a patch or what an op expects), and an import of a bundle with a button that shows an image or with an image field fail with NotImplemented before anything is sent, and details.needs and details.serverVersion say which side to update. Reading works against an older server: its push buttons read hasImage: false and takesImage: false, and its widgets layout: 'caption' for a push button's and null for the rest.

@cloudpdf/sdk@3.5.0

Minor Changes

  • #1163 – Who fills a form field in, as one assignment: FormField has it (a FieldAssignment: group, anyone or unassigned), and FormFieldDraft and FormFieldPatch take it beside groupId. It needs a server of version 3.5: an older one refuses a draft or a patch that names it, so send such a server groupId.

  • #1168 – A form field says which signed signature locked it: FormField.lockedBy is a FieldSignatureLock (signatureIndex, source), or null. A server older than 3.5 leaves it out.

  • #1173 – A form field's placeholder, the text its author wants shown while the field is empty: FormField has it (a string or null), and FormFieldDraft and FormFieldPatch take it. It needs a server of version 3.5: an older one refuses a draft or a patch that names it.

  • #1190 – The SDK has the change op forms.repeat and its result item: ChangeOp.FormsRepeat (field, pages, which is 'all' or a list of page refs, as and objectNumbers) and ChangeItem.FormsRepeat (as, fields, widgets, dropped, calculationOrder, meta, and undone in an undo).

  • #1191 – FormField.Checkbox and FormField.Radio have hasValuesList: whether the PDF names the widgets' values in a list in the field (/Opt), as Acrobat does for values that repeat or aren't plain names.

  • #1165 – A push button's image and a widget's layout: WidgetAnnotation, WidgetPlacement and WidgetPatch have layout ('caption', 'image', 'caption-below', 'caption-above', 'caption-right', 'caption-left', 'caption-over', or null for a widget that isn't a push button's), a push button's FormField has hasImage and takesImage (whether it is an image field, which a person fills with a picture), its FormFieldDraft and FormFieldPatch take takesImage, and ChangeOp has forms.setButtonImage ({ field, resources: { image } }, the image's part key or null). They need a server of version 3.5.

@embedpdf/plugin-actions@3.5.0

Minor Changes

  • #1181 – A plugin can ask for a scratch script realm of the open document: createScratchScriptRealm() on the host contract (@embedpdf/plugin-actions/contract/host).

    It is a realm with the policy, environment and name-tree scripts of the document's own, and a sandbox of its own, so nothing a script does in it reaches the document's realm. The caller owns its lifetime and destroys it. It is there only when JavaScript is on, like scriptRealm. The form plugin runs validateValues() in one, so a check of a form leaves the form's scripts as they were.

@embedpdf/plugin-annotation@3.5.0

Minor Changes

  • #1180 – An armed stamp's preview in a box says what it sits in. hoverGhostIn({ page, box, rot, into }) takes the address of what a click puts the stamp into (the signature plugin's mark into a form field's box), and getImageGhost(page).into gives it, so the plugin that draws that box can leave out what the stamp will cover. ImageGhost and ImageGhostPlace gain the optional into; a preview at the pointer has none.

    Escape puts an armed stamp away. createAnnotationCommands() has a second command, annotation:disarm-stamp (label commands.annotation.disarmStamp, "Cancel stamp"), with the shortcut Escape. It is enabled only while a stamp is armed and calls stamps.disarm(), so the tool goes back to the one from before the arm, as it does when a signature mark goes into a field. Each framework's annotationCommands and standardCommands carry it: an app that uses one of them with the command shortcuts gets the key, and takes it from the page only while a stamp is armed.

  • #1167 – A lender says everything it paints over a record in one call, paintOf(): its live drawing, its accent, a placeholder (the words an empty form field shows for its purpose, which the annotation layer writes in the field's box in design mode) and an outline (the edge of a record with no border of its own and no accent). A lender without paintOf() is asked for painter() and accentOf() as before, and painter() can now be left out.

    A lent record follows its lender's live drawing: when the lender lists its records again and draws one another way, or no longer draws it, the record is made again. Before, it kept the drawing it had first, with painter() too. A lender keeps a record as it is by handing out the same function for it.

    A lender can also paint what its tools place with toolPaintOf(), which gives the same paint: a form field tool's ghost is then the field it places, see-through, with its look, tint, outline and placeholder.

  • #1169 – A push button's tool (widget-button) may set layout in its defaults, so a form tool can place a button whose box shows its image alone, as the image field tools do.

  • #1170 – Disarming a stamp goes back to the tool that was active when it was armed: stamps.disarm(), and through it the stamp plugin's disarm() and a signature mark that goes into a field. When that tool is gone, it goes to the default tool. Before, the stamp tool stayed active with nothing armed, so the form layer stayed down and the next click asked for a file. A stamp stays armed while it's placed, a second arm keeps the first one's tool, and switching to another tool still disarms the stamp and keeps the tool picked.

    The armed stamp's preview can show in a box a sibling plugin's click would put it in, instead of at the pointer: hoverGhostIn({ page, box, rot }) on the host lens, null to give it back to the pointer, with the new ImageGhostPlace type. A new or dropped arm and a tool change clear it. The signature plugin uses it to show a mark in the field it goes into.

  • #1186 – A selected box that is small on screen shows four corner handles outside its corners and moves when its inside is dragged. With eight handles on its outline, a checkbox or radio button in the form builder was covered by its own handles, and every press on it resized it. A box with a side under six times chrome.handles.size (48 px by default, measured on screen, so zooming in brings the side handles back) now shows its corner handles only, each just outside its corner. Its outline stays on its own edge, a drag of its inside moves it, and its handles are grabbed on themselves and outward, with a mouse and with a finger alike. listChromeNodes() lists those four handle nodes at their places, so a custom handle component draws them there unchanged. The box around several selected annotations follows the same rule, the layout follows a box while it is resized, and a box with both sides of 48 px or more looks as it did.

    A handle moves as far as the pointer travels from the press: a press beside a handle no longer makes a box's corner or a line's end jump to the pointer. Dragged past the page's edge, a handle takes its box to the edge. Where the grab zones of two handles meet, the nearer one is taken, and the rotation handle is weighed with them: with a finger, a press on a resize handle of a small or turned box no longer starts a rotation where the two zones overlap.

  • #1189 – A tool with fixed stamp bytes (source: { kind: 'bytes', source }) shows its ghost: the stamp's image, see-through, in the box a click places it in, as an armed stamp does. Before, such a tool showed no ghost at all, whatever its ghost setting. The bytes are read once, at the first hover or click, and bytes that aren't a picture are reported once instead of at every click.

    A stamp places the bytes it was sized and previewed from. A click with a tool's fixed bytes or an armed stamp, and stamps.place(), send the engine a copy taken when the bytes were read, so a caller that reuses its buffer afterwards no longer gets the new picture in the old picture's box.

    ImageGhost gains preview, which renders the ghost's image at a device pixel width: the same function while the ghost shows the same stamp. Each call returns bytes of its own, which the caller may keep or transfer to a worker; before, every request for a stamp's preview shared one buffer, so a transfer left later requests with no bytes. getImageGhost(page) covers a tool's fixed bytes as well as the armed stamp. renderArmedStampPreview() on the host lens is deprecated in favour of getImageGhost(page)?.preview.

@embedpdf/plugin-commands@3.5.0

Patch Changes

  • #1180 – createStandardCommands() keeps the commands it had: the annotation plugin's new annotation:disarm-stamp is not in it. Your framework package's standardCommands has it.

@embedpdf/plugin-form@3.5.0

Minor Changes

  • #1180 – A box says who fills its field in. Each entry of listWidgets() has assignment beside groupId: { kind: 'group', groupId }, { kind: 'anyone' } or { kind: 'unassigned' }, as its field has it. groupId alone is null for the last two.

    A box shows no placeholder while an armed stamp's preview sits in it: placeholder is null for the box the annotation plugin's getImageGhost(page).into names, the field's own placeholder and its purpose's label alike, and comes back when the preview leaves. Before, "Signature" or "Initials" showed through a signature mark's preview. The layers draw what the box says, so nothing changes in them.

    A field a signed signature locked is nobody's to fill in: canFill(ref) is false for it, its box is disabled, not yours and has canFill: false, validate() leaves it out and a write to it rejects permission-denied, also when the lock leaves the field's read-only flag off, and right after a signing in the same session. The engine finds the lock by the field's name, and the plugin hands it the whole field.

  • #1174 – An empty field shows its own placeholder, the text its author wrote, before its purpose's label. What listWidgets() gives as a box's placeholder now follows one rule, while filling, in design mode and in a field tool's ghost: the field's own placeholder, shown as written and never translated; else the label of its purpose, in the viewer's language; else nothing. The conditions are the ones a label had: a text field, a dropdown, a signature field and an image field show it, while the field is empty, a signature box holds no drawn mark, and, while filling, the field is the user's.

    • form.update(ref, { placeholder }) and form.create({ placeholder }) write it, and null takes it away. One the engine would refuse (an empty string, white space at an end, more than 256 characters) is rejected with invalid-input before anything shows or is sent, and never trimmed. A CloudPDF server older than placeholders refuses the change itself, which the verb rejects as unsupported with the engine's details.
    • getFieldSettings() lists placeholder after the tooltip for the four kinds that show one: a text setting with trimmed: true and maxLength, the most characters a placeholder takes (the engine's FIELD_PLACEHOLDER_MAX_LENGTH). A panel writes a trimmed text without the white space typed at its ends, and null when nothing is left, and gives its input the setting's maxLength, so typing stops there and a longer paste is cut to it. FormFieldSetting has the new variant.
    • A field tool gives its fields one: formPlugin({ tools: [{ id: 'form-iban', extends: 'form-text', field: { placeholder: 'NL12 ABCD 0123 4567 89' } }] }). The ghost shows it before the click, and a tool whose placeholder no field can have is refused when the document opens.
    • A copy keeps it, and an undo puts it back in one step.

    A field with a purpose and no placeholder of its own shows what it showed.

  • #1167 – Fields say what they are for, and dates work without JavaScript.

    • Each box of listWidgets() has its field's purpose and format, and a placeholder: the label of the purpose while a text field, a dropdown or a signature field is empty, and a signature box holds no drawn mark. Its color is the new fields.placeholder setting.
    • form.prefill() writes the user's name, email address, organization and job title into their own empty fields by purpose, and today's date into a date-signed field (in its date pattern, else yyyy-mm-dd), as one change and one step to undo. It resolves what it wrote and what it left, with the reason. A date field read with JavaScript off takes today from ctx.clock too.
    • New field tools, five of the signing tools, place a text field with a purpose: signer-name, signer-email, signer-organization, signer-organization-title and signer-date-signed (a read-only date field). formPlugin({ tools }) changes a field tool or adds your own from an existing one: { id, extends, field, defaults, clickCreate }.
    • getFieldSettings() describes a field's purpose (a choice; listPurposes() has the labels) and, for a text field and a dropdown, its format (a new format control with the kinds and Acrobat's patterns).
    • With JavaScript off, what is typed into a date or a time field is still checked against the field's pattern and shown the way the pattern writes it, as the field's own scripts do. Before, such a field took any text. validation: 'none' still accepts everything.
    • setValue() called before the form's fields are read waits for them, as setValues() does, so the value is checked: by the form's scripts, or by a date or time field's own pattern. Before, a value written right after documents.open() skipped both and was saved as typed.
    • formatDate(), parseDate(), isDatePattern(), isTimePattern(), STANDARD_DATE_PATTERNS and STANDARD_TIME_PATTERNS are exported for a date picker of your own.
    • With the i18n plugin, a purpose's label is in the viewer's language, and so is the day of signing's hint, "Filled in when you sign", which a box gives the person whose date it is.
    • One tint per field, the viewer's paint, never saved: a box's accent is its group's color, else the new fields.tintColor (null, off, by default), which the accent then names as its setting, and a box says whether it's yours to fill in. A box that isn't yours (another person's field, a read-only one, a signed signature) has no accent and no placeholder. In design mode a lent field with no border of its own and no tint gets an outline in fields.border, and a field tool's ghost is the field it places: its look, its tint, its outline and its placeholder.
    • Who a field is for is its assignment: a group, anyone or nobody. setDesignAssignment() and getDesignAssignment() say who fields placed with a tool are for (the state's designAssignment; onDesignGroupChanged carries assignment), assign() gives fields an assignment as one step to undo, and canAssign() says whether the user may give one: anyone takes fields:set-group:all. setDesignGroup(), getDesignGroup() and moveToGroup() stay, as the shorthand for a group or nobody. An assignment goes to the engine as it is, and what is no assignment, such as a misspelt kind, is refused with invalid-input before anything changes (assign(), update(), create(), setDesignAssignment()); canAssign() answers false for it. getFieldSettings() describes an assignment setting (a new assignment control) beside groupId.
    • A field anyone fills in shows in the new fields.anyoneTintColor ('#0891b2'), read as "Anyone" after its name, in the viewer's language. The signature tools, form-signature and signer-signature, place nothing while fields are placed for anyone, and prefill() leaves such a field ('for-anyone').
    • The day of signing is one signer's, as a signature is. The signer-date-signed tool (and a tool of your own with the purpose date-signed) places nothing while fields are placed for anyone; assign(), update() and create() refuse { kind: 'anyone' } on a date-signed field with invalid-input, and update() refuses that purpose on a field anyone fills in; the settings offer neither. A group's and nobody's both work, so a form without groups has its date. validate() never lists a date-signed field, required or not: nobody types it, so a signer is never asked for one.
    • A box is yours only while it takes input: the fillable setting counts too, so a box it leaves out has no tint and no placeholder, and neither has a field a signature locked.
  • #1181 – form.validateValues() checks the whole form against its own rules without writing, validate() also lists every required field, and a signature field with a mark drawn in it counts as filled in.

    • A signature field is filled in once it is signed or a mark is drawn in it. Before, it stayed empty until it was signed, so a required signature field could never be completed where marks are drawn without signing (the signature plugin's 'visual' mode). A box's empty, validate(), focusNext({ empty: true }) and the placeholder all follow the one rule. Taking the mark out makes the field empty again.
    • validate() returns required too: every required field the user fills in, empty or not, in page order, so "2 of 5" is required.length - missing.length of required.length. For a signature field it asks the right to sign the field, where it asked the right to fill it in: a signer whose scope has fields:sign for their group and no fill right for it now has their signature field counted, and a user who may fill in every field but sign only some is no longer asked for the others' signatures.
    • validateValues() resolves what validate() returns, and invalid: each field of the user's whose value one of the field's own rules refuses, as { field, message } with the rule's message (null when it gives none). It runs the keystroke and validate scripts of each field that holds a value, as entering that value would, whatever the validation setting says; without JavaScript, a date or a time is checked against its field's format. It changes no value, runs no calculation or format script, raises no alert and fires no event. It finds what a batch (setValues(), importValues()), the file itself, validation: 'none' or a rule that reads another field let through. The scripts run in an engine started for the check and thrown away after it, with the document's own scripts run afresh, so the form's scripts are as they were, the next edit is told what it would have been told, and a check's answer doesn't depend on the checks and the edits before it (a rule that reads the clock can still answer differently later). Its whole answer is of the form as it shows when the check's turn comes. A form that could not be read, or whose last read failed, is read again and never called valid: the check rejects with that read's error, and permission-denied without doc.forms.read.
    • A dropdown with a date or a time format is checked with JavaScript on too. Text that is no date is refused, as it already was with JavaScript off: with the default validation, setValue(ref, { value: 'next week' }) on such a dropdown now resolves rejected where it resolved applied, and validateValues() names such a value. The form plugin makes the check itself, since a dropdown's keystroke script is not run, and only where that script is the one the format goes with, as it is for a format set here or in Acrobat. A date goes on to the dropdown's validate script. What is checked, and what the field then shows as a date, is what the dropdown shows: the label of the option that is chosen, not the value it exports, with JavaScript on and off. With JavaScript on, a dropdown's format script is given that label too, as in Acrobat, where it was given the export value; the field keeps the export value. validation: 'none' still lets any text through.
    • focusNext({ required: true }) goes only to the fields validate() counts as required.
    • fields.required, a CSS color, is the edge of a required field of the user's that is still empty. It is null at first, which shows no such edge, and --epdf-form-field-required wins over the color once it is given.

    An app that compares the whole result of validate() with what it expects sees the new member, and one that keeps a whole FormSettings object has a new fields.required to give.

  • #1183 – form.isDesigning() says whether the form is being designed now, and the form's state has it as designing: the active tool is one of the form's design tools (form-edit, a field tool, or a tool of your own that carries form-design), the user may design, and the annotation plugin is there. Read it for a Design switch of your own, where comparing tool ids misses a tool you add.

  • #1190 – form.repeat(ref, { pages, as }) shows a field at the same place on more pages, as one change and one step to undo. It is the engine's doc.forms.repeat(): one write, whatever the number of pages. pages is 'all' or a list of pages, each a ref or an index. What a page gets follows from what the field holds, unless as says otherwise:

    • A value is one answer ('boxes'). A text field, a checkbox, a dropdown, a list, a radio group and a plain push button get one more widget of the same field on each page, with the look, the flags and the actions of the one it repeats, so every page shows the field's one value. A page the field already shows on is left as it is. A radio group's buttons on the other pages keep their values, and the group gets radiosInUnison, so the buttons of one value go on and off together.
    • A mark is made on each page ('fields'). An image field, such as initials, becomes a new field on each page but its own, as duplicate() makes one: named after the original (initials_2), with its settings, its look and its scripts, and with no value and no picture.
    • A signature field isn't repeated. It rejects with invalid-input, and so does a field that shows on no page. The new form.canRepeat(ref) says beforehand whether a field can be repeated.

    What is repeated is what the field shows on the page of its first widget, every widget it has there. A place is measured from the top-left corner of its page as the page is shown: on a page shown turned another way a copy stands where its original is seen and reads the same way, and a copy that would stand past the edge of a smaller page is moved in to stand on it.

    It resolves { fields, widgets, dropped } (FormRepeatResult): the new fields in the pages' order, or for widgets the field as it is now; the new widgets; and what was left out, such as a script without doc.forms.script. It needs doc.forms.modify. The copies show when the engine answers, and it fires onFieldUpdated once for the field, or onFieldCreated for each new field. One call reaches at most as many pages as the engine takes (2,000 by default): more is rejected with invalid-input, details.limit is 'pages', and nothing is made. Against a server older than the verb it rejects with unsupported.

    The form's mirror now drops the row of a widget whose adding was undone: after an undo of addWidget(), or of a repeat, getWidget() no longer answers the widget that went.

  • #1169 – Image fields: a push button that takes an image (takesImage) is an image field, filled with a picture. The engine reads that fact from the press Acrobat's own image fields have, and the plugin follows it alone.

    • form.setButtonImage(field, { source } | null) puts a PNG, a JPEG or a one-page PDF in, or takes it out, as one change and one step to undo. It is filling in, gated by canFill(); the box says it holds a picture at once. It rejects invalid-input for a push button that is no image field, and a call cancelled while its picture loads writes nothing.
    • Its box is a new control: 'image', with hasImage: every box of a push button with takesImage: true, and no other. A button that only shows a picture, such as a logo in a box with layout: 'image', stays control: 'button', and so does an icon-only print or submit button. Never by the field's name, its layout or its picture.
    • Upgrading from 3.4: a box that was control: 'button' is control: 'image' when its field is an Acrobat image field, a push button whose press runs event.target.buttonImportIcon(). An app that draws its own controls gets the new kind there, and typed code that covers every control needs a case for it. No other button changes.
    • An image field takes a value: it is empty while it holds no picture, so a required one is listed by validate(), it shows its purpose's placeholder, its tint and counts as yours like any field that takes a value. prefill() leaves it.
    • Two tools place one, with takesImage: true and layout: 'image': signer-initials (purpose initials, 72 × 36), a signing tool, and form-image (120 × 90), a form tool. form-signature places its field with the purpose signature, so an empty one shows "Signature". A tool's field takes takesImage on a push button's tool.
    • addWidget() copies the last box's layout with its look, and an image field's new box is an image box.
    • getWidgetAt() says whether the box under the point is an image field's, with imageBox, by the same rule.
    • A box's press, changed with updateWidget(), and a box added or deleted change what its button is at once: the field's takesImage and each box's control follow without a reload.
  • #1170 – Design mode is now the form's own tools only: the widgets are lent to the annotation plugin while the active tool carries the new form-design tag, which form-edit and every field tool carry. Before, any tool that didn't fill forms (a stamp, a pen, a highlight, zoom) lent them to whoever may design, so a click with a stamp selected a field and showed its handles. A tool of an app's own that should design the form carries form-design too.

    • Under any other tool that doesn't fill forms, the form layer shows the fields as it does while filling, with their tints, edges and placeholders, but they take no input and no pointer, so the tool works over them. The host lens says which with getLayerMode(): 'fill', 'design' or 'show'.
    • A box's placeholder sits where its value will: placeholderAlign on every box says where. A text field and a dropdown keep their own alignment; a signature field and an image field centre it, where the mark and the picture go. A lent field's placeholder carries the same as align.
  • #1182 – Signing tools: a second family of built-in field tools, signer-…, for preparing a document for signing, beside the form tools, form-….

    • A signing tool places a field with no border and no background of its own (color: null and interiorColor: null in the tool's defaults), and required. The PDF draws nothing for an empty one, so nothing prints; the viewer shows it by its paint: its tint, else an edge in fields.border, and what it is for.
    • The seven: signer-signature (the signature field form-signature places), signer-initials (an image field), signer-date-signed (a read-only date field, and the one that isn't required: nobody types the day of signing), signer-name, signer-email, signer-organization and signer-organization-title (text fields). Each is signer- and the purpose its field has.
    • The form tools keep their look and stay not required: a box with a border and a background. They are form-text, form-checkbox, form-radio, form-combobox, form-listbox, form-button, form-signature and the new form-image.
    • Both families are there from the start. FORM_TOOLS and the tools the annotation plugin lists have eight entries more than in 3.4, the seven signing tools and form-image, so a palette drawn from either shows eight more tools.
  • #1187 – The form plugin's host lens can write the day of signing again: setSigningDate() writes today's date into the session's own date-signed fields whatever they hold, as one change and one step to undo, in each field's date pattern, else yyyy-mm-dd. The signature plugin's finish() calls it before it checks the form, so a rule of the form that reads the day of signing is asked with the day that is signed, and the signed revision holds that day, not the day prefill() ran. A field anyone fills in is skipped, as prefill() skips it, and so is one that holds today's date already. It resolves { applied, skipped, failed }, as setValues() does.

    commitDraftTexts(), also on the host lens, writes every field's draft at once and resolves each draft's result. The signature plugin calls it before a signing, so the text someone is still typing is what gets checked and signed.

    A draft now leaves in these ways and no other: the form takes it; text is typed in its place; discardDraftText() gives it up; or, once its box was left, its field takes another value. Before, any write of a draft took it, whatever the form said. What an app with its own text boxes sees:

    • commitDraftText() keeps a draft the form's own rules refuse. Called again for it, it asks the form again and resolves that result, where it resolved null. commitDraftTexts() tells that draft as rejected each time without writing it, so a signing is refused until the person has dealt with it. Call discardDraftText() when a box that was left shows its field's value again and is left once more; the form layer's own text box does.
    • A download asks the form about a draft once, as before, and leaves a refused one in its box: leaving that box afterwards asks the form again, and onValidationRejected fires again.
    • A draft whose write fails stays when a download or commitDraftTexts() wrote it, and the next one writes it again. When commitDraftText() rejects, the draft is gone, as before: the box puts the field's value back.
    • A draft is written once while its write is on its way. commitDraftText() for a draft a download is writing resolves that write's result, where it resolved null.

    validateConfirmed(), also on the host lens, is validateValues() of the form as the engine holds it: it reads the form from the engine for the check, so none of the session's pending changes is in it, and resolves what validateValues() resolves with the form it read (snapshot; the new type is FormConfirmedValidation). finish() calls it once the engine has prepared the signing and takes no change, so its last check is of exactly what the signature covers. It writes nothing and doesn't change what the form plugin shows.

@embedpdf/plugin-i18n@3.5.0

Minor Changes

  • #1180 – Add the label of the annotation plugin's annotation:disarm-stamp command, commands.annotation.disarmStamp ("Cancel stamp"), in the eight built-in languages.

  • #1167 – Add the names of what a form field is for (form.purposes.name, email, organization, organization-title, date-signed, signature, initials) and the labels of six signing tools (commands.tool.signer-signature, signer-name, signer-email, signer-organization, signer-organization-title, signer-date-signed), in the eight built-in languages.

    Add the day of signing's hint, form.hints.date-signed ("Filled in when you sign"), in the same eight languages.

    Add what a field anyone fills in reads as after its name, form.anyone ("Anyone"), in the same eight languages.

  • #1169 – Add the labels of the two image field tools, commands.tool.signer-initials ("Initials field") and commands.tool.form-image ("Image field"), in the eight built-in languages.

@embedpdf/plugin-signature@3.5.0

Minor Changes

  • #1169 – placeMark(mark, { field }) on an image field (a push button with takesImage: true) puts the mark in as its picture through the form plugin's setButtonImage(), whatever the mode: filling in, with the right to fill the field in, one step to undo. It never signs or asks, resolves 'filled' and fires onFilled. It rejects invalid-input for any other push button, one that only shows a picture among them. An image field can be the target, as the form layer makes it on a press.

    A mark armed from a signatures library and clicked over an image field the user fills in now goes into the field as its picture, in place of one it holds, and the tool disarms; before, it was placed as a stamp on the page. Over an image field that isn't theirs (read-only, another group's, or left out by the form's fillable setting) the click does nothing. Over any other push button, such as an action button or a button that only shows a logo, it is still placed as a stamp.

  • #1170 – A mark armed from a signatures library and clicked over another person's signature field now does nothing and stays armed, as over an image field that isn't theirs: one rule for both, a box whose fill control is disabled takes no mark. Before, it tried to sign the field, the write was refused and the console logged "placing the mark failed". A mark that goes into a field now returns the user to the tool they had before arming it, so the fields take input again.

    A mark armed from a signatures library shows what a click does while it hovers. Over a field it goes into, its preview sits in the field as the fill will draw it: fitted whole and centred, inside an image field's border, turned with a turned field. Over a field that isn't the user's there's no preview and the cursor is not-allowed. Anywhere else the preview follows the pointer, as before, when it used to vanish under the field's tint even over the field it fills.

  • #1187 – A signer can sign as their last step: the new 'finish' mode draws a mark into a signature field without sealing, and signature.finish() checks their fields, writes the day of signing and seals their part with one signature. …

Patch Changes

  • #1180 – An armed mark's preview in a field names the box it sits in (into on the annotation plugin's hoverGhostIn()), so the form plugin shows no placeholder under it. Before, the field's "Signature" or "Initials" showed through the preview.

    canSign(field) and canFill(field) are false for a signature field an earlier signature locked, sign() and fillField() reject permission-denied for it before anything starts, and an armed mark over it does nothing and stays armed.

Full notes

@embedpdf/plugin-stamp@3.5.0

Patch Changes

  • #1170 – disarm() now goes back to the tool that was active before armAsset(), or to the default tool when that one is gone, instead of leaving the stamp tool active with nothing armed. Switching to another tool while a stamp is armed still disarms it and keeps that tool.

@embedpdf/core-annotation@3.5.0

Minor Changes

  • #1167 – A lent record can carry a placeholder (RecordPlaceholder: a few words and their color), which its render item hands to the layer: what an empty form field is for, shown in design mode.

    A lent record can carry an outline too (RecordOutline: the lender's edge for a record with no border and no accent), and an accent can name the setting its color is the value of (setting, a path such as 'form.fields.tintColor'), so a renderer lets what overrides that setting, its CSS variable on the web, win over the color. unmadeItem() takes the lender's paint (LentPaint: drawing, accent, outline, placeholder), so a tool's ghost is painted through the same path as the record it places.

  • #1170 – A lent record's placeholder (RecordPlaceholder) can say where its words sit across the box with align: 'left', 'center' or 'right'. Left out, they follow the record's own text alignment, as before.

  • #1186 – A small box shows its four corner handles only, outside its corners, and is moved by its inside. ChromeGeometry has an optional handleSize and chrome() takes the same size as an optional sixth argument: with it, a box with a side shorter than six handles (a checkbox, a one-line text field, any box on a zoomed-out page) gets four corner handles, each half a handle outside its corner, where eight on its outline covered it and took every press. hitTest() gives the inside of such a box to the box, so a drag there moves it, and gives a handle a press on it or outward from it. A handle that would leave the page stays on it, and where that puts it over its box, in the page's corner, a press on the handle as it is drawn takes it. A callout's tip and knee are taken inside its small text box as anywhere. The box around a multi-selection follows the same rule, and the layout follows a box while it is resized, with the handle being dragged always drawn. Without a handle size, as from a ChromeGeometry built for 3.4 or a chrome() call with five arguments, every box keeps all eight handles on its outline.

    geomHandleLayout(shape, handleSize, page?) gives that layout as a HandleLayout (small, and a HandleSpread saying how far the handles stand out from each side). geomHandles(shape, layout?) and a ShapeFamily's handles(shape, layout?) take it, and a family may answer the new optional handleLayout() for its own boxes.

    A handle drag moves a box's corner or side, or a line's or polygon's point, as far as the pointer has travelled since the press: the handle and group drafts carry the press as an optional start. It went to the pointer, so a press beside a handle made the box jump by up to the grab size. The travel is the pointer's own, past the page's edge too, so a handle dragged off the page takes its box to the edge wherever on the handle the press landed. A corner, a line's end or a group box that starts past the page's edge stays where it is until the pointer moves it, comes onto the page with the pointer, and goes no further out. Where the grab zones of two handles meet, hitTest() takes the nearer handle; it took the first in the list. The rotate knob is weighed with them: where its zone and a handle's both hold a press, the nearer of the two takes it, the knob when they are as near. The knob took every press in its zone, so a finger on a corner handle of a small or turned box could start a rotation. With the default sizes the zones only meet for a finger, and on a big box the top handle's reach towards the knob grows from 8 to 16 px.

Patch Changes

  • #1176 – Every render item says how it blends with the page, a drawing in progress included: blend is now set for a highlighter stroke, a polygon, a measurement, a callout and a text highlight while they are being made. It was set only for a made annotation, a tool's ghost and a box or a line being dragged out, and the others left the blend to their shapes. A painter puts the blend on the item's frame, so a drawing the annotation layer raises above the form's fields multiplies with the page while it is drawn, as it does once made.

  • #1169 – widgetAppearanceOf() carries a form tool's layout default to the widget it places.

@embedpdf/core@3.5.0

Minor Changes

  • #1180 – AssignedField, what ctx.allowsField() and ctx.assertAllowedField() take, has the field's name. The engine finds a signed signature's lock on a field by that name, so a plugin passes the whole field: a field a signature locked is then refused, whatever the session's permissions. A caller that passes { groupId } or { groupId, assignment } alone is answered by the permissions, as before.

  • #1167 – A plugin's clock says what day it is: ctx.clock.today() gives the host's calendar day (CalendarDay: year, month from 1, day), the device's own in its time zone unless the host clock passes today(). manualClock({ today }) fixes the day for a test.

    ctx.allowsField() and ctx.assertAllowedField() take a field's assignment beside its groupId (AssignedField), and pass both to the session's own check, which reads the assignment first: a field anyone fills in is every signer's, as the engine has it, and a refusal for one names doc.forms.fill (doc.sign), as the engine's does. A caller that passes { groupId } alone is answered as before.

Patch Changes

  • #1179 – A mirror's page reload no longer undoes a change that was confirmed while it ran: an annotation deleted, restored by an undo and deleted again by a quick redo stays deleted on screen. A page reload (reload({ pages }), read through loadPages) wrote the pages as the engine held them when it made the read, over events that had been folded since. Now those events, still folded as they arrive, are folded again over what the read brought: the pages are merged into the value from before them, so each holds once, and one that asks for a reload there gets it. A change that waits for its page reload is drawn in view() in the place of its event, with every event confirmed since folded over what it shows, so what the engine confirmed later shows later, whoever made it: a redo shows over the undo at every moment, and so does another session's change. A mirror also runs one read at a time, a full load or a page reload, so a read never lands after one that started later: the pages requested while a read runs are read after it, together, and a change that made several page reloads stays in view() until the last one lands. An event sent the moment the mirror tells of a change keeps its place behind the one being told, also while a load lands. A failed page reload is reported and followed by a full load, instead of leaving the mirror in error with the change it kept drawn over everything that came after; the status is error only when that full load fails too.

@embedpdf/core-signature@3.5.0

Minor Changes

  • #1187 – sign() takes afterPrepare, a function it calls once the engine has prepared the signing and before the key is asked to sign. From the prepare until the signing is done the engine refuses every change to the document, so what is read there is exactly what the signature will cover: the place for a last check of it. When afterPrepare rejects, sign() cancels the signing and rejects with the same error, and the key signs nothing. Without the option sign() does what it did.

@embedpdf/engine-core@3.5.0

Minor Changes

  • #1163 – Who fills a form field in is one fact, FormField.assignment: one group's signers ({ kind: 'group', groupId }), anyone ({ kind: 'anyone' }), or no one in particular ({ kind: 'unassigned' }). Every user who may fill in some field may fill in a field anyone fills in, whatever group their permission names; a user who may fill in no field still can't, and a group's permission still doesn't reach an unassigned field.

    • The type. FieldAssignment is the union, in the public list both engine packages export. FormField.groupId stays, and reads the group's id, or null for anyone and unassigned.
    • Writes. FormFieldDraft and FormFieldPatch take assignment beside groupId, its shorthand: a group id for that group, null for unassigned. Either works from any assignment; both in one write, or { kind: 'anyone' } on a signature field, is refused with InvalidArg (details.field: 'assignment'). draftAssignment() and assignmentAfter() work out what a create and an update leave, as the engine does; assignmentOfGroup(), groupIdOfAssignment() and assignmentsEqual() go between an assignment and a group id.
    • The checks. checkFieldAction(), allowsFieldWrite() and authorizeFieldWrite() take a FieldAssignment beside a group id alone, and DocumentSecurityService.allowsField('fill' | 'sign', field) reads the field's assignment, else its groupId. A field anyone fills in takes any fill right: doc.forms.fill, fields:fill:all or a fields:fill:group=….
    • Rights. authorizeFieldAssignment(): a group takes fields:set-group for it, anyone fields:set-group:all, since it reaches every group, and unassigned nothing. fieldRights().setGroup is { all: true } exactly when a user may give a field to anyone.
    • Prediction. formFieldOfDraft() and formFieldAfter() give the assignment, and the groupId it reads as, as the engine reads them back.
    • The wire. A named FieldAssignment component, a closed union on kind. FormFieldDTOSchema reads a field of a server older than assignment by its group, and completeFormBundle() does the same for a bundle kept from before it. FIELD_ASSIGNMENT_SINCE ('3.5') is the version it arrives in on the wire.
    • Conformance. runAnyoneFieldsConformance() and its fixture ANYONE_FIELDS_PDF hold both engines to the rules, the lock included.

    A field built by hand as a FormField (a test fixture) needs assignment.

  • #1168 – A form field says which signed signature locked it: FormField.lockedBy is a FieldSignatureLock ({ signatureIndex, source }, source being 'fieldmdp' or 'lock'), or null.

    • The one lookup. fieldLockRefusing(action, fieldName, protection, enforced) gives the lock that refuses a fill or a signing of a field: a signing whatever the policy, as the runtime authors no signature into a locked field, a fill only where the engine enforces the document's signatures. fieldSignatureLockOf() turns a document's lock into what a field reads. DocumentFieldLock now extends FieldSignatureLock.
    • The check. DocumentSecurityService.allowsField('fill' | 'sign', field) takes the field's name beside its group and assignment, and answers false for a field such a lock covers. A target without a name, as 3.4 callers pass, is checked as before.
    • The wire. A named FieldSignatureLock component. FormFieldDTOSchema reads a field of a server older than lockedBy as locked by nothing, and completeFormBundle() does the same for a bundle kept from before it. FieldSignatureLock is in the public list both engine packages export.
    • Conformance. runFieldLocksConformance() and its fixture FIELD_LOCKS_PDF, a sealed file whose lock leaves the locked fields not read-only, hold both engines to the rule.

    A field built by hand as a FormField (a test fixture) needs lockedBy.

  • #1173 – A form field holds a placeholder: FormField.placeholder, the text the form's author wrote to show in the field while it is empty, such as 'name@example.com'. It is kept with the field, beside its purpose, and is never the field's value. Every kind of field holds one or null, and the engine reads nothing into it: which fields show one, and how, is its reader's to decide.

    • Writes. FormFieldDraft and FormFieldPatch take placeholder: a text, or null for none, which a draft also says by leaving it out. It takes what a purpose takes: 1 to 256 characters with no white space at its start or end and no NUL character. Anything else is refused with InvalidArg (details.field: 'placeholder'), not trimmed. isFieldPlaceholder() and checkedPlaceholder() are the rule, as isFieldPurpose() and checkedPurpose() are a purpose's.
    • Prediction. formFieldOfDraft() and formFieldAfter() give the placeholder as the engine reads it back.
    • Transfer. A form bundle's field carries it, a copy and an import write it, and completeFormBundle() reads a bundle kept from before it with placeholder: null.
    • The wire. FormFieldDTOSchema reads a field of a server older than placeholders with placeholder: null, and the draft and patch schemas take the member. FIELD_PLACEHOLDER_SINCE ('3.5') is the version it arrives in on the wire.
    • Conformance. runFieldPlaceholderConformance() and its fixtures FIELD_PLACEHOLDER_PDF and FIELD_PLACEHOLDER_SIGNED_PDF hold both engines to the rules: text in any language through a save, an undo, a copy and an import, and what a signature allows.

    A field built by hand as a FormField (a test fixture) needs placeholder.

  • #1174 – FIELD_PLACEHOLDER_MAX_LENGTH, the most characters a form field's placeholder takes, is exported beside isFieldPlaceholder() and checkedPlaceholder(), so a settings panel gives its input the limit the engine checks.

  • #1162 – Deprecate FormField.filledBy, filledByName and filledAt: they always read null, because a fill no longer records who filled a field in. A fill writes only the value and its drawing, as every PDF app does, so a signature made before it stays valid. FormValuesImportOptions.attribution is deprecated too and has no effect. All four go in 4.0. runFormAttributionConformance takes a sign option, for an engine whose server judges a completion's CMS.

  • #1181 – isKeystrokeOfFormat(format, keystroke) is exported from @embedpdf/engine-core/runtime: whether a field's keystroke script is the one its date or time format goes with.

    A field's format is read from its format script alone, so a field can show a date without checking one. This tells a caller that the file asks for the check too. The form plugin uses it to check a dropdown's date itself where the document's scripts run, since a dropdown's keystroke script is not run.

  • #1190 – doc.forms.repeat(ref, { pages, as }) shows a form field at the same place on more pages, as one change: on every page (pages: 'all') or on the pages named. It is the new change op forms.repeat (field, pages, as, objectNumbers), so it works on the local and the cloud engine, goes in a change with other ops, and one undo takes all of it away.

    • What a page gets follows from what the field holds, unless as says: one more widget of the field ('boxes') for a field with a value, a new field ('fields') for an image field. A signature field is refused with InvalidArg.
    • What is repeated is every widget the field has on the page of its first one. The place is measured from the top-left corner of the page as it is shown, so a copy on a page shown turned stands where a reader sees the original and reads the same way, and a copy that would stand past the edge of a smaller page is moved in.
    • As boxes a page the field already shows on is left as it is, and a radio group gets radiosInUnison in the same op. As fields each page but the field's own gets a field named as a copy is (initials_2), with no value.
    • It resolves FormRepeatResult: as, fields (the field as it is now, or the new fields), widgets (the new widgets' rows), dropped and meta. Its result item has the same members, and an undo of a repeat answers the same item with undone: true.
    • Events. As boxes one forms.widgetAdded for the field, with every new widget's row; as fields one forms.created per field. An undo is one item too, with undone: true: as boxes it fires one forms.widgetRemoved, whose meta.changedWidgets names the widgets that went, and as fields one forms.deleted per field, its item's fields holding the fields that went.
    • Limits. A repeat reaches at most BundleLimits.pages pages and makes at most BundleLimits.items widgets and fields; more is refused with PayloadTooLarge before anything is written.
    • Versions. forms.repeat arrived in 3.5 (CHANGE_KIND_SINCE): a client holds it back from an older server, and a server sends an older client full-refresh in its place.

    The rule is one pure function, which the engine applies and a viewer can use: planFormRepeats (with formRepeatPlaceOf, formRepeatRefusalOf, formRepeatDefaultOf and the types FormRepeatAs, FormRepeatOptions, FormRepeatPage, FormRepeatPlan, PlannedRepeatWidget), and planFormRepeat in @embedpdf/engine-core/validation, which also checks each new field against the create schema. addedWidgetChecked says whether a widget added to a checkbox or a radio group shows checked.

    runFormRepeatConformance in @embedpdf/engine-core/conformance checks all of it on any engine. Its fixture is REPEAT_PAGES_PDF, four pages with one shown turned and one smaller, and its options are FormRepeatConformanceOptions.

    planFormRepeats takes limits (FormRepeatLimits) and refuses past them with PayloadTooLarge before it plans anything. formRepeatScopeOf says what a repeat would reach (FormRepeatScope: the pages that get something and how many widgets and fields it makes) without planning any of it, for a viewer to check a repeat before it sends it.

  • #1191 – A checkbox's and a radio group's hasValuesList says whether the PDF names its widgets' values in a list in the field (/Opt), as Acrobat does for values that repeat or aren't plain names: each widget's exportValue is then the list's entry at its place, and its onState only a key. An answer from a server without it reads false. addedToggleStates gives the on-state names of new checkbox or radio widgets: the one given, else the one the field's widgets of the same value have, else the value itself, or in a group with hasValuesList the lowest number its widgets don't use. planFormRepeats keeps each copy's on-state (PlannedRepeatWidget.onState), so the copies of one value go on together in such a group too. runFormRepeatConformance checks such groups: copies and new buttons read back their values and switch in unison, a list that repeats the on-state names, a list of one Yes, a deleted button, and undo and redo with the list read from the saved file.

  • #1165 – A push button can hold an image, as Acrobat's image field does: doc.forms.setButtonImage(field, image | null) puts a PNG, a JPEG or a one-page PDF in every widget of the field, or takes it out. The image is one part of the button's look, which is drawn from the image, the caption and the layout.

    • layout on a widget (WidgetLayout): where a push button's widget shows its caption and its image (/MK /TP): 'caption', 'image', 'caption-below', 'caption-above', 'caption-right', 'caption-left' or 'caption-over'. All seven read from the file, and a placement (create(), addWidget()) and updateWidget() write any of them. Every other widget reads null and refuses one; a push button's widget always has one, so null is refused there.
    • hasImage on a push button (PushButtonField): whether one of its widgets has an icon (/MK /I), one setButtonImage() put in or another app made.
    • takesImage on a push button (PushButtonField, its draft and its patch): whether it is an image field, which a person fills with a picture. A PDF has no such field type: Acrobat's is a push button whose press runs one script, event.target.buttonImportIcon(), so the engine reads the fact from that script and writes the script when the fact is set. It reads true when the button has a widget and every widget's activation action or mouse-up action is that script and nothing else; a button that only shows an image, a logo say, reads false, and so does one whose press does anything else. takesImage: true in create() or update() writes the script as each widget's activation action, as Acrobat writes it, and false takes it off each widget whose press is exactly it. It is form design and takes no doc.forms.script. It is refused with InvalidArg (details.field: 'takesImage') when a widget's press already runs another action, which is never overwritten, when a create names it beside a widget's actions.activate or actions.mouseUp, when the button has no widget, and on any other kind of field. A widget added to an image field gets the script too, and a copy and an import of an image field make one without doc.forms.script. takesImageOf(), pressImportsIcon(), isImportIconScript() and IMPORT_ICON_SCRIPT are the reading, and formFieldOfDraft() and formFieldAfter() predict the write.
    • A predicted widget holds its actions as a read does. widgetAfterPatch(), formFieldOfDraft(), annotationOfDraft() and applyAnnotationPatch() give a widget's actions the shape a read gives: each written event as its PdfActionTree, with its subtype, a uri's isMap and a submit's whole payload; an event the write leaves out kept, an event set to null and actions: null removed, and null when no event is left. Until now the written patch replaced the row's actions as it was written, so a predicted row lost the events a patch left out and held actions no reader of a read could follow. actionReadOf() is the rule for one action, the inverse of actionWriteOf(), and widgetActionsAfter() for a widget's patch; actionTreeOf() and a format's scripts follow the same rule. A created push button's predicted takesImage follows its rows, so one whose placements write the import script itself reads true before the engine answers too. pressPatchOf() is what a takesImage write writes to one widget.
    • doc.forms.setButtonImage() is filling in: it takes doc.forms.fill, or fields:fill for the field's group (any signer's, for a field anyone fills in), and a field a signature locked refuses it with ProtectedDocument. A signing that names no lock locks a field anyone fills in once it holds an image, as it does one that holds text. It is one change with one undo step, the op forms.setButtonImage of doc.apply ({ field, image }), and emits forms.updated. Each widget shows the image as its layout says, which is left as it is.
    • A place added later gets the image: addWidget() on a push button that holds one gives the new widget the same image, as a text field's new widget shows its value. It shows it as the placement's layout says; without layout: 'image' the new place keeps the image and shows its caption.
    • The image is stored once, however many push buttons, signature fields and stamps show it. A copy with its values (doc.forms.copy()) keeps a push button's image, and a form bundle carries it as the widget's image resource, once. A field marked noExport exports without it (hasImage: false, no resource), as without its value.
    • Signatures: an image is filling in. doc.signatures.analyze() counts a push button's image as filling in, as Acrobat does: putting one in or taking it out (a change of /MK /I and nothing else in /MK, and the drawing under it) is permitted after an approval signature and after a certification that allows form filling. A field a signature locked stays forbidden, and so does a change to a button's caption, colors or layout under such a certification.
    • Reading an older side: a field or a bundle without hasImage or takesImage reads false for it, and a widget row without layout reads 'caption' for a push button's and null for any other (WidgetDTOSchema, FormFieldDTOSchema, completeFormBundle()). BUTTON_IMAGE_AND_LAYOUT_SINCE ('3.5') is the version they arrive in on the wire, takesImage in a draft and a patch too, and forms.setButtonImage is a change kind of that version. On the wire the op names its image's part as resources: { image } (ButtonImageResourceKeysSchema).
  • #1187 – fieldHoldsValue(facts) is the one rule for whether a form field holds a value, with fieldValueFactsOf(field) and the type FieldValueFacts: text that isn't empty (a text field, a dropdown), a checkbox or a radio button that is on, a selected option (a list), a picture (a push button). A signature field holds none, signed or with a mark drawn in it.

    • The rule reads a kind and one fact, so the engine answers it from its own reads and a viewer from a field it has read: fieldHoldsValue(fieldValueFactsOf(field)). A radio group is judged by its buttons, not by the value it exports.
    • The engine's default lock asks it. A signing with no lock of its own locks the fields anyone fills in that hold a value, as it did: the answer for every kind is the one it was.
    • Conformance. runSigningFlowConformance() holds an engine to signing as a person's last step: a mark drawn into a signature field seals and locks nothing, a signing with no appearance keeps the mark the field shows (and shows nothing for a field that holds none), what was written before the signing is inside the signed revision, the signature locks its signer's group and leaves the next signer's fields open, once a signing is prepared the form reads as it will be sealed and takes no change until the signing is completed or cancelled, and after the next signer finished the same way the changes since the first signature are permitted. It also pins the rule kind by kind against what the default lock locks. It is exported from @embedpdf/engine-core/conformance with SigningFlowConformanceOptions and SigningFlowSigning.

    No engine behavior changed.

Patch Changes

  • #1161 – A new look on a signature field that nobody signed no longer reads as a forbidden change.

    A mark drawn into such a field (forms.setSignatureAppearance()) and saved after someone else signed made analyze() and validateSignatures() read that earlier signature as forbidden: "is referenced from object N at AP/N and no rule explains it". Acrobat keeps the signature valid: after an approval signature it reports the document as not modified, and after a certification that allows form filling (permission: 2) it reports a permitted change. The engine now reads it as permitted, with the rule signature-appearance, when the field and its widgets change their /AP and nothing else and everything the new appearance draws with is new.

    A new look on a signed field stays forbidden: it replaces the look the signature was made with. Acrobat doesn't report that change. When an unsigned signature field changes more than its appearance, the analysis now names the keys that changed instead of every reference to the field.

    SIGNATURE_POLICY_VERSION is 6, so analyses cached on the cloud are computed again.

@embedpdf/engine-runtime@3.5.0

Minor Changes

  • #1191 – EPDFForm_AttachWidget takes the new widget's value (export_value, before split_objnum). A checkbox or radio group may name its values in a list in the field (/Opt), as Acrobat does for values that repeat or aren't plain names: a widget's value is the list's entry at its place, and its on-state only a key. The new widget's value now goes in that list at its place, so it reads back as given; before, it had no entry and read Yes. A field without a list refuses a value other than the on-state. EPDFForm_DetachWidget takes the widget's entry out of the list, so the widgets after it keep their values; before, each read the value of the widget before it. A list that is an object of its own, or a parent field's, stays as it is: the field gets a list of its own. The new EPDFForm_HasFieldValuesList reads from the form model whether a checkbox or radio group has such a list.

Patch Changes

  • #1185 – Redoing a page's delete deletes the page again after its annotations or form fields were drawn. When the page held annotations or fields of the file without a stored appearance, drawing them for the first time after the undo left a copy of each among the document's changes, so the redo took the page for one someone had changed and left it in place.

  • #1184 – Undoing a change to a text field, a dropdown or a list box brings back its drawing, so the field shows what it showed before the change. The value and the look already went back, but the drawing stayed as the change left it, on the page and in a downloaded file, until the field was written again. That goes for a new value, a reset, a text a format script shows and a new look.

@embedpdf/engine-services@3.5.0

Minor Changes

  • #1163 – Read and write who fills a form field in as one assignment, a group, anyone or unassigned, and lock a field anyone fills in at the first signature after it holds a value, by one rule on the local and the cloud engine.

    • Stored in the field's /EMBD_Metadata: a group as /GroupID, as before, anyone as /ForAnyone true, unassigned as neither. A create and an update write it, and a copy, an export and an import keep it. An import completes the bundle first, as reading a file does: a row an earlier version wrote, without an assignment, is its group's, or unassigned. A /ForAnyone entry beside a group, or on a signature field, counts for nothing, and goes when an update leaves the field without a group.
    • Writes. A create and an update take assignment or the groupId shorthand, each from any assignment: a group id for that group, null for unassigned. Both in one write, or anyone on a signature field, fail with InvalidArg, and nothing is written.
    • Filling in. Every fill check, a reset's, a values import's and an undo's or redo's included, lets every user who may fill in some field fill in a field anyone fills in.
    • Signing. A signature without a lock of its own now also locks every field anyone fills in that holds a value at that signing (text that isn't empty, a checkbox or radio button that is on, a selected option), whoever filled it in, the sender included; the FieldMDP lock names them beside the rest of the signer's group. This holds for a signature field in no group too, which locked nothing before and still locks nothing when no such field holds a value. A field still empty stays open for the next signer. A signing that names its own lock, and a document timestamp, add none.
    • A signature field's own lock. A signature field that carries a /Lock of its own signs with that lock alone, when the signing names no lock: nothing is added to it, neither these fields nor the rest of its group. Before, a field in a group with a /Lock that didn't name exactly its group's fields refused to be signed (SignatureRefused), as the runtime refuses a lock other than the field's own.
    • Undo. An update's undo puts the assignment back whole, also when the update named only groupId, and only while it still holds what the update left: a field another update gave to someone since stays theirs, and the update's other properties still go back.
    • Rights. Anyone takes fields:set-group:all, a group fields:set-group for it, and unassigned form design alone, on a create, an update, a copy and an import that copies; the assignment a field already has takes none, and a restoring import keeps each field's under its own rights. FormCopier and FormImporter take an optional assignmentOf, which decides a field's whole assignment; groupOf becomes optional, and decides a group's or an unassigned field's only without it.

    A document in which no field is anyone's behaves as before.

  • #1168 – Every form field read says which signed signature locked it (lockedBy), from the same lookup a write refuses a locked field by, whether or not the field is marked read-only. The lookup is read once for each version of the document and doesn't depend on the policy: under signedDocumentPolicy: 'permit' a field still names its lock, while writes go through. readFieldAt() and readFormFields() take the lookup (fieldLocksOf()), null where none is known.

  • #1173 – Read and write a form field's placeholder, the author's text for the empty field, by one rule on the local and the cloud engine.

    • Stored in the field's /EMBD_Metadata as /Placeholder, beside /Purpose, as a PDF text string, so text in any language is kept as it was written. Never in the tooltip (/TU) or the default value (/DV). An entry that is no placeholder a write takes (another tool's, or one with space around it) reads as null, so every placeholder read can be written back.
    • Writes. A create and an update take placeholder, on every kind of field: a text sets it, null takes it away, and left out it stays. One that breaks the rule fails with InvalidArg, and nothing is written. It is form design (doc.forms.modify): a fill never writes it, and it is never the field's value.
    • Changes. An update's expect compares it, and an undo puts it back.
    • Copies. A copy, an export and an import keep it.
    • Signatures. As for every design write, a field an earlier signature locked refuses it with ProtectedDocument. On a field a signature covers and leaves open it is written, and the change analysis judges it as it judges a purpose: a change of the field's own entry after the signature.
  • #1190 – The engine applies the new change op forms.repeat: a form field shown at the same place on more pages, in one pass. The form is read once, every copy is written, and the field is read back once, so the work grows with the number of pages and not with its square. Its undo and its redo are one step each, as quick as the repeat: as boxes the new widgets leave their pages and the field's dictionary goes back, and only that dictionary is kept for the undo; as fields the new fields are deleted together, with the form read once. On the local engine 2,000 pages take about 0.3 s to add as boxes and 0.1 s to undo, and about 3 s each way as fields.

    • FormMutator.addWidgets() adds several widgets to a field as one write, and addWidget() is that with one widget. FormMutator.deleteFields() deletes several fields as one write.
    • A widget added to a checked checkbox now shows checked, and so does a button added to a radio group with radiosInUnison whose value is on. Before, a new checkbox or radio widget always started off, whatever the field held.
    • A copy of fields (forms.copy) and a design import no longer read each new field back as they make it: the fields are read once at the end. Copying 400 fields took about 1.1 s on the local engine and takes about 0.2 s.
    • Undoing addWidget() is now that same one step. Each new widget leaves its field's own list of widgets and its page's list of annotations, wherever the file keeps them: a field whose /Kids is an object of its own kept a reference to the deleted widget in the saved file, and a page whose /Annots is one kept the widget on the page, out of its field. A field stored as one object with its widget goes back where its split widget stands now, so a reorder since stays. Its redo answers forms.addWidget (it answered forms.removeWidget). It captures the field's dictionary only, not every widget the field has.
    • An undo leaves what someone changed since: a create's, a copy's, an import's or a repeat's field whose widget was moved or restyled since stays, and so does an addWidget() or repeat whose new widget was.
    • A deleted field's undo, and a repeat's redo, leave out a field whose name another field now sits under or above (billing beside billing.name); they checked the exact name only.
  • #1191 – addWidget() and repeat() add widgets to a checkbox or radio group whose values a list in the field names (/Opt, hasValuesList): the new widget's value goes in the list at its place, so it reads back the value it was given and goes on with that value. A value the group has takes that value's on-state, and a new value the lowest number the group's widgets don't use; a repeat keeps each source's. Their undo takes the entries back out of the list and their redo puts them back, and removing or deleting a widget takes its entry out, so the widgets after it keep their values. A checkbox or radio group is read with hasValuesList.

  • #1165 – A push button holds an image, and a mark in a signature field is stored once however many fields show it.

    • forms.setButtonImage puts an image (a PNG, a JPEG or a one-page PDF) in every widget of a push button as its icon (/MK /I) and draws each widget again from it, or takes it out. A widget's layout (/MK /TP) is read and written; a push button reads hasImage.
    • A push button reads takesImage, whether it is an image field, from its widgets' press: every widget's activation action or mouse-up action is Acrobat's import-icon script and nothing else. forms.create and forms.update write it: true writes that script as each widget's activation action and false takes it off where the press is exactly it, both without doc.forms.script, and true is refused while a widget's press runs another action. forms.addWidget gives an image field's new widget the script. An update's undo puts each press back as it was.
    • A mark drawn into a signature field, signed or not, is now a drawing the document holds once, as a stamp's picture is: the same picture in ten fields saves as one image, not ten. A file saved before reads as it did, and its marks are found again when the same picture is placed.
    • forms.addWidget on a push button that holds an image gives the new widget the same drawing as its icon; its layout is the placement's.
    • A copy with its values keeps a push button's image, a form export carries it as the widget's image resource (except for a field marked noExport), and an import places it.
    • A signing that names no lock locks a field anyone fills in once it holds an image, as it does one that holds text.

Patch Changes

  • #1162 – Fill in a field, or draw a mark into a signature field and sign it, after another signature, and that signature now stays valid. A fill used to stamp who filled the field into its /EMBD_Metadata, and a mark recorded its fit on the widget: Acrobat and analyze() both read those changes as the document altered after signing. A fill now writes only the value and its drawing, and a widget reads as holding a mark from its drawing alone.

  • #1187 – The default lock of a signing asks @embedpdf/engine-core's fieldHoldsValue() whether a field anyone fills in holds a value, where it had the rule of its own. It reads what it read, and locks what it locked.

Other packages

46 more packages get a new version with no changes of their own.

Don't miss a new core release

NewReleases is sending notifications on new releases.