This either adds a FipHdr and/or extra fields to an EPS file as a Pdfmark 
    or  creates or extracts or displays a FipHdr from a PDF file 

It checks the magic number to detect which way to go !

For EPS files, the new file replaces the existing file.
For PDF files, you can create a new file with the FipHdr with or without the
data or just display the FipHdr.

Input parameters are :
 - Mandatory
    filename    this must be the last parameter if there are several

 - Optional
    -D : Display the FipHdr from a FipHdr       default: no
    -o : filename of the PDF FipHdr file        default: \SN
        default is the contents of the SN field in the current dir
        -o /fip/spool/pdfin/\\SN
    -N : End the FipHdr file            default: no end
    -R : do NOT replace a FipHdr file of the same name  default: do.

    -k : tag                    default: /FIP-X-
    -K : sub tag                    default: none

    -S : strip FipHdr off the EPS file      default: no
    -e : String in EPS file to add the Pdfmark after
        The pdfmark is added after the end of the line.
        If an existing pdfmark DOCINFO exists - it is added to that
        and this is ignored.
            default: %%EndComments
        remember to double quote if an escaped chr
        eg sffpdfmark -e "%%BeginDocument" rubi.eps
    -E : add PdfMark AFTER the whole EPS document
        (if there is a -t top stub file, this is added at the %%EndComments)
    -b : PS stub to add just before the DOCINFO.    default: none
    -t : PS stub to add just after the %%EndComments. default: none
    -h : Extra FipHdr to add to the EPS file    default: none
        eg sffpdfmark -h "SU:source#DF:redomark" bongo.eps
    -M : generate a Mirror style adlist from the PDF /Contents  default: dont
    -m : show all Contents -  Mirror style debugging    default: dont
    -v : version and exit

For those switches with parameters, the parameter MUST be separated by a space.

An EPS file has a pdfmark added with a line for each FipHdr
    /FIP-X-ZZ (option contents)
    where ZZ is the FipHdr field.

The PDF file - we just extract the /FIP-XX-ZZ fields.

eps -   sffpdfmark -S -h "YI:\YI#YS:\YS" (file)
    sffpdfmark -S -E -b PDFMARK.bottom -t PDFMARK.top -h
"PS:$FN\\nPH:$ThisHost\\nPQ:$returnQue" -i $1

pdf -   sffpdfmark -o /fip/spool/p3wheel/\\YI (file)

Mirror Ad Stack
    sffpdfmark -M -h "DF:BEM.ADS" -o /fip/spool/2edsys/\\SN (file)

Version Control
;001f   25jul05 added Mirror contents
    ;d - Page has '18 (26)'
    ;e-f 19may08 SDR for mirror
;000g   04oct00 chris original version

(copyright) 2017 and previous years FingerPost Ltd.