-1

I am trying to create an editable HTML textarea component using TCPDF API library. I want to display a scrollable text box on the screen.

Can this be done?

Current TCPDF examples include these: https://tcpdf.org/examples/ I know PDFs can have editable components, but I am not sure how to create them with TCPDF, if it is at all possible.

TD;DR: how can I generate a page with a scrollable textarea using PHP + TCPDF?

Linked Answer using another library (mPDF):

Note that while How to create editable Pdf form in php may work, it does not make use of TCPDF library. My existing codebase relies heavily on TCPDF, I would like to explore the possibility of using TCPDF before I consider adding another library ...

i.e. I rather have an answer of "Not possible" than to use another library at this time.

Dennis
  • 6,954
  • 8
  • 53
  • 97
  • You'll need to do some more homework before this is on-topic, right now it's way too abstract and there's a multitude of ways this could work out, each of which is a lot to explain. – tadman Nov 02 '17 at 21:02
  • Possible duplicate of [How to create editable Pdf form in php](https://stackoverflow.com/questions/17610629/how-to-create-editable-pdf-form-in-php) –  Nov 02 '17 at 21:03
  • @tadman, what kind of homework do I need to do? I need an editable HTML textarea component using TCPDF. How can I make this into a more concrete question? – Dennis Nov 02 '17 at 21:25
  • You'll need to have some code, any code, that demonstrate what you're trying to do. If you're note even sure where to start, that's fine, but it's off-topic here. If you need mentoring or coaching try services like [Codementor](https://www.codementor.io), [Savvy](https://www.savvy.is), [Hackhands](https://hackhands.com), or [airpair](https://www.airpair.com). – tadman Nov 02 '17 at 21:29

1 Answers1

0

It looks like the issue is two-fold.

First, you can use a typical form example, like here: https://tcpdf.org/examples/example_054/ However, you cannot see editable fields in a browser, at least you cannot in Mozilla Firefox 56.0.2 as the time of this writing. (https://support.mozilla.org/en-US/questions/1006115)

What you need to do is open the generated PDF in a different viewer that supports editable form fields, such as Adobe PDF reader/other.

Then you can fill out the textarea and if text size exceeds the area of the form element, it will have scroll bars added to the textarea.

Dennis
  • 6,954
  • 8
  • 53
  • 97