At 12:07 PM 4/25/2003 -0700, you wrote:

>This might be a silly question, but I'd like to know
>if it is possible to create a modifiable field on the
>resulting PDF document. Is there any way I can tell
>the FOP, through an attribute may be, to create a
>field that can be modified by the user should he have
>to?

I assume you mean, "modified by the user on the command line"?
If it were me, I would use a shell script (*nix) or batch file
(Windows) which accepts an argument. That argument would be one
or more strings to change just before printing. The batch file
might look something like this:

   @echo off
   :: filename: MODIFY.BAT, a sample Windows batch file
   ::
   :: If no argument is given, the .FO file is processed normally.
   :: If an argument is given, alter the .FO file before sending
   :: it to FOP for processing. The argument string may not
   :: contain an equal sign.
   ::
   :: If there was no argument passed, print the file normally.
   IF "%1"=="" GOTO print
   :: Implied ELSE is we have an argument, so execute this instead.
   echo We were given the following user change: %1
   set VAR=%1
   ::
   :: Execute sed (stream editor) or awk or perl or python or whatever.
   :: This example uses sed, since it's small, fast, free and open source.
   sed "s=fixed-string=%VAR%=g;" yourfile.fo >temp.fil
   ::
   move /Y temp.fil yourfile.fo
   :print
   call fop.bat yourfile.fo yourfile.pdf
   ::end

If you need help explaining any of this, let me know. The basic idea is
that you have a fixed string in "yourfile.fo" which will print "as is"
unless you intend to change it. That string might be an email address
like "[EMAIL PROTECTED]" or a date like "April 2003".  If no argument is passed
on the command line (you type "modify" and press ENTER), the resulting
.PDF file will contain that literal string. But if you pass a command like:

    modify [EMAIL PROTECTED]

or
 
    modify "April 25, 2003"

then "[EMAIL PROTECTED]" will be replaced with "[EMAIL PROTECTED]" , or the 
general
date of "April 2003" will be replaced with "April 25, 2003" and so forth.
The batch file could be revised to expect more than one substitution.

This example could be changed to interactively prompt the user for a
value, or it could run under a different command shell (like 4NT or
bash). Hope this helps. Write me if you have further questions.


-- 
Eric Pement - [EMAIL PROTECTED]
Education Technical Services, MBI


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to