Re: Does anyone here use TCPDF?
| From: | Paul M Foster | Date: | Sat, 19 Sep 2009 04:40:01 +0000 |
| Subject: | Re: Does anyone here use TCPDF? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-298174@lists.php.net to get a copy of this message | ||
On Sat, Sep 19, 2009 at 02:58:52AM +0900, Dave M G wrote:
> PHP List,
>
>
> I posted this question on the TCPDF forum on SourceForge, but it's
> getting no response. I'm not even sure how active their list is.
>
> http://sourceforge.net/projects/tcpdf/forums/forum/435311/topic/3400663
>
> So I'm hoping someone here might be able to help if they are using
> TCPDF. I just need to get the key details to get started, and then I can
> probably start to roll on my own.
>
> This is the question:
>
>
> Forgive me for what I would assume is a very obvious question, but I can
> not locate any clear instructions on what I want to do.
>
> Simply, I want to take an existing PDF and write text on top of it.
>
> The PDF is a single page, and it is a form that people fill out. What I
> need to do is fill out some of the fields in the form before sending it
> to the recipient.
>
> So I need to do two simple tasks. One is to load an existing PDF file.
> The second is to place short lines of text into specific locations on
> the page (A4 size).
>
> I know these two functions must be dead simple, and yet I am lost in the
> documentation.
>
> If someone could tell me the right function calls or point me to the
> right place so that I can RTFM on my own, I would be very grateful.
>
> Thank you for any advice.
I don't use TCPDF; I use FPDF, but I imagine the drill is about the
same. When I have to do what you're doing, I first write the code (using
the FPDF API/methods) to build the form fresh. I test this to ensure
everything is where it needs to be. Then I add code to that form which
fills in whatever fields need filling in. Then I output that.
What you're asking sounds like you want to *edit* an existing PDF via a
PHP class, and I don't know of a tool that does this except for Adobe
Acrobat and a few other non-PHP tools. It's something that's very
difficult to get right.
Therefore, I'd suggest instead using your existing TCPDF methods to
actually *build* the PDF from scratch, with additional method calls to
put in your content. That is, build and populate each time you need the
form.
Paul
--
Paul M. Foster