Re: [PHP] convert MS DOC -> PDF

2005-02-28 Thread Richard Lynch




mbneto wrote:
> Hi,
>
> I have a bunch of M$ WORD documents (rtf and doc) that I'd like to
> transform to pdf.
>
> It would simple except that I'd like to allow the user to fill a
> couple of variables (name, email, telephone) and replace this before
> if generates the pdf.
>
> After searching the net I found some classes but in order to use it
> seems that I have to rewrite the entire document and some documents
> have tables/images.
>
> Any tips ?

Use MS Word "templates" or form letters or whatever they are called, and
you can provide the CSV file to feed it?

Then you just have to convert the Word doc to PDF, which is sort of
straight-forward.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] convert MS DOC -> PDF

2005-02-27 Thread mbneto
Hi Jochem,

My system runs on linux so the com part seems to be out.

What I refer as rewrite is that the classes that I saw have some
primitives where I have to call in order to write the text, images and
so on.

Ideally I'd take my word documents, replace the dynamic parts with
special codes so when the user fills the values I'd replace such
occurencies and generate de pdf.


On Sun, 27 Feb 2005 15:14:12 +0100, Jochem Maas <[EMAIL PROTECTED]> wrote:
> mbneto wrote:
> > Hi,
> >
> > I have a bunch of M$ WORD documents (rtf and doc) that I'd like to
> > transform to pdf.
> >
> > It would simple except that I'd like to allow the user to fill a
> > couple of variables (name, email, telephone) and replace this before
> > if generates the pdf.
> >
> > After searching the net I found some classes but in order to use it
> > seems that I have to rewrite the entire document and some documents
> 
> how do you mean 'rewrite' exactly? if the it takes 3 lines of code
> but the PDF is generated twice do you really care too much? (maybe
> you have specific speed/thruput requirements?)
> 
> > have tables/images.
> >
> > Any tips ?
> 
> maybe you can use COM to create a Word object, load the file add some
> your vars (possibly inserting them at predetermined bookmarks in the
> Word file?) and then generate the PDF?
> (maybe you need to save the new Word file first, depending on what tool
> you use for the transformation)
> 
> alternatively you can open you newly generated pdf file with:
> 
> $x = pdf_open_file($pdf, "/path/to/pdf/file");
> 
> and then modify the file - maybe add a frontpage with a nice logo
> and the information taken from the user given variables - you
> wouldn't have to make any changes to the originally generated pages.
> 
> http://www.zend.com/zend/spotlight/creatingpdfmay1.php?article=creatingpdfmay1&kind=sl&id=273&open=1&anc=0&view=1
> http://nl2.php.net/manual/en/ref.pdf.php
> 
> -- it might also be possible to create a template pdf that automatically 
> displays
> some author/doc metadata; then when you generate the PDF you only need to
> add the user given variables as metadata and it will display in the file:
> 
>  PDF_set_info($pdf, "author", "John Coggeshall");
>  PDF_set_info($pdf, "title", "Zend.com Example");
>  PDF_set_info($pdf, "creator", "Zend.com");
>  PDF_set_info($pdf, "subject", "Code Gallery  Spotlight");
> 
> I'm just guessing that its possible to display an  field in the PDF
> in similar way to, for Instance, MSWord.
> 
> >
> > - mb
> >
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] convert MS DOC -> PDF

2005-02-27 Thread Jochem Maas
mbneto wrote:
Hi,
I have a bunch of M$ WORD documents (rtf and doc) that I'd like to
transform to pdf.
It would simple except that I'd like to allow the user to fill a
couple of variables (name, email, telephone) and replace this before
if generates the pdf.
After searching the net I found some classes but in order to use it
seems that I have to rewrite the entire document and some documents
how do you mean 'rewrite' exactly? if the it takes 3 lines of code
but the PDF is generated twice do you really care too much? (maybe
you have specific speed/thruput requirements?)
have tables/images.
Any tips ?
maybe you can use COM to create a Word object, load the file add some
your vars (possibly inserting them at predetermined bookmarks in the
Word file?) and then generate the PDF?
(maybe you need to save the new Word file first, depending on what tool
you use for the transformation)
alternatively you can open you newly generated pdf file with:
$x = pdf_open_file($pdf, "/path/to/pdf/file");
and then modify the file - maybe add a frontpage with a nice logo
and the information taken from the user given variables - you
wouldn't have to make any changes to the originally generated pages.
http://www.zend.com/zend/spotlight/creatingpdfmay1.php?article=creatingpdfmay1&kind=sl&id=273&open=1&anc=0&view=1
http://nl2.php.net/manual/en/ref.pdf.php
-- it might also be possible to create a template pdf that automatically 
displays
some author/doc metadata; then when you generate the PDF you only need to
add the user given variables as metadata and it will display in the file:
PDF_set_info($pdf, "author", "John Coggeshall");
PDF_set_info($pdf, "title", "Zend.com Example");
PDF_set_info($pdf, "creator", "Zend.com");
PDF_set_info($pdf, "subject", "Code Gallery  Spotlight");
I'm just guessing that its possible to display an  field in the PDF
in similar way to, for Instance, MSWord.
- mb
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] convert MS DOC -> PDF

2005-02-26 Thread mbneto
Hi,

I have a bunch of M$ WORD documents (rtf and doc) that I'd like to
transform to pdf.

It would simple except that I'd like to allow the user to fill a
couple of variables (name, email, telephone) and replace this before
if generates the pdf.

After searching the net I found some classes but in order to use it
seems that I have to rewrite the entire document and some documents
have tables/images.

Any tips ?

- mb

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php