From: Dave M G on
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.

--
Dave M G


From: Paul M Foster on
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
From: "Ralph Deffke" on
have a look in the archive of this list. there is a topic "writing japanese
test in an excisting pdf" its of 31. of August, this should helph u

ralph_deffke(a)yahoo.de


"Dave M G" <martin(a)autotelic.com> wrote in message
news:4AB3CA5C.3050807(a)autotelic.com...
> 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.
>
> --
> Dave M G
>
>


From: Dave M G on
Ralph, Paul,

Thank you for responding.

> I don't use TCPDF; I use FPDF, but I imagine the drill is about the same
>
I tried using FPDF, but it did not support UTF-8/Japanese. It claims
some support in the documentation, but after much experimentation, I
verified it does not. That is why I switched to TCPDF.

> What you're asking sounds like you want to *edit* an existing PDF via a
> PHP class,

No, I just want to write on top of it. And that was possible with
FPDI/FPDF, but I had to abandon those as they did not support Japanese.

I attempted to use the same functions as FPDI/FPDF, but they did not
work in TCPDF.

> have a look in the archive of this list. there is a topic "writing japanese
> test in an excisting pdf" its of 31. of August, this should help
>

That was a thread I started. Things have changed slightly since I now
know that only TCPDF supports Japanese.

So I still need to know if/how to write text into a PDF, like I did with
FPDF, but with TCPDF instead.

If this turns out to not be possible, I am going to be suffering a great
deal.

--
Dave M G
From: "Ralph Deffke" on
Hi Dave,

if its the case u could do a good deal, why u don't climp urself into the
pdf format? It is nothing else then a presentation format, not magic,
complicated and huge yes, but at the end just a text file. I am not that pdf
specialist, but I know at least for the older pdf formats the enconding is
open and well documented. I have a book on my shelf called 'pdf bible' an it
explains the pdf byte code.

Another idea would be to contact all the companies creating these pdf
converters (html pdf, word-pdf, pdf-word) they should be able to tell u the
answer.

And even may be there is a programm u could use in a OS batch process to put
ur text in.
At least just contact Adobe and ask them how to do it, u might get an
answer.

sorry thats all I have coming up in my mind for now.

ralph_deffke(a)yahoo.de

"Dave M G" <martin(a)autotelic.com> wrote in message
news:4ABB1E10.9070207(a)autotelic.com...
> Ralph, Paul,
>
> Thank you for responding.
>
> > I don't use TCPDF; I use FPDF, but I imagine the drill is about the same
> >
> I tried using FPDF, but it did not support UTF-8/Japanese. It claims
> some support in the documentation, but after much experimentation, I
> verified it does not. That is why I switched to TCPDF.
>
> > What you're asking sounds like you want to *edit* an existing PDF via a
> > PHP class,
>
> No, I just want to write on top of it. And that was possible with
> FPDI/FPDF, but I had to abandon those as they did not support Japanese.
>
> I attempted to use the same functions as FPDI/FPDF, but they did not
> work in TCPDF.
>
> > have a look in the archive of this list. there is a topic "writing
japanese
> > test in an excisting pdf" its of 31. of August, this should help
> >
>
> That was a thread I started. Things have changed slightly since I now
> know that only TCPDF supports Japanese.
>
> So I still need to know if/how to write text into a PDF, like I did with
> FPDF, but with TCPDF instead.
>
> If this turns out to not be possible, I am going to be suffering a great
> deal.
>
> --
> Dave M G