question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to set a image for a form field?

See original GitHub issue

Can pdf-lib be used to programmatically fill form field with a image in a template PDF I tried like this,but failed

const sigAppearanceStream = PDFContentStream.of(   
  PDFDictionary.from({
    Type: PDFName.from('XObject'),
    Subtype: PDFName.from('Form'),
    BBox: PDFArray.fromArray([
      PDFNumber.fromNumber(0),
      PDFNumber.fromNumber(0),
      PDFNumber.fromNumber(200),
      PDFNumber.fromNumber(50),
    ], pdfDoc.index),
    Resources: PDFDictionary.from({
      XObject: PDFDictionary.from({}, pdfDoc.index)
    }, pdfDoc.index),
  }, pdfDoc.index),
    drawImage('MarioEmblem', {
      x: 447,
      y: 520,
      width: marioEmblemDims.width * 0.75,
      height: marioEmblemDims.height * 0.75,
    }),
);

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Hopdingcommented, Jul 20, 2019

@FilipeAraujo I do plan to greatly improve pdf-lib’s support for signatures and acroform fields. I’m currently working on finishing v1.0.0, which includes a new high level API for pdf-lib’s existing features. After that, one of the things I’d like to work on is better acroform and signature support. I can’t commit to a specific timeline. But hopefully it’ll be done within a few months.

0reactions
FilipeAraujocommented, Jul 8, 2019

@ConandSherry thanks! however, would it be great to do this without changing the pdf-lib core. @Hopding do you have something in the pipeline related to this? thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Add a Form to an Image - W3Schools
Learn how to add a form to a full-width image with CSS. ... Step 1) Add HTML: ... <input type="text" placeholder="Enter Email" name="email"...
Read more >
<input type="image"> - HTML: HyperText Markup Language
<input> elements of type image are used to create graphical submit buttons, i.e. submit buttons that take the form of an image rather...
Read more >
How to… Add Images to a Form (using Gravity Forms)
To add a stand-alone image to a form, open the specific form and then select the HTML field, which you will find under...
Read more >
HTML <input type="image"> - GeeksforGeeks
The HTML <input> type attribute is used to specify the type of <input> element to display. The default type of <input> type attribute...
Read more >
how to add custom image icon inside input textbox ... - YouTube
put custom icon images inside the input textbox element html using css styles.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found