You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Daniel Brown <Da...@binarytree.com> on 2005/10/04 23:11:55 UTC

watermark

How can I create a watermark? I've read the documentation/FAQ about 
watermarks. I need an Image which will fit being the center of the text on 
the page in the body and continue to remain centered on all the following 
pages in that sequence.

Thank you,
Daniel

Re: watermark

Posted by Glen Mazza <gm...@apache.org>.
Daniel Brown wrote:

> 
> How can I create a watermark? I've read the documentation/FAQ about 
> watermarks. I need an Image which will fit being the center of the text 
> on the page in the body and continue to remain centered on all the 
> following pages in that sequence.
> 

I'm not sure of FOP's capabilities in this regard, and the European 
committers who do know are probably counting sheep right now, but 
"watermark" is highly searchable:

http://marc.theaimsgroup.com/?l=fop-user&w=2&r=1&s=watermark&q=b

Glen

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: hide header/footer

Posted by Glen Mazza <gm...@apache.org>.
Prakash R wrote:

> Is there a way to hide the header/footer for a
> particular page within a page-sequence? I just want to
> hide the header/footer for a particular page not the
> last or any alternate page. I know there are ways to
> do that. But is there a way to hide header/footer for
> a random page in between?
> 
> Thank you.
> Prakash
> 

I'm unsure what you mean by "hide"--have the fo:region-body occupy the 
space allocated for the fo:region-before and fo:region-after areas, or 
have the fo:region-before and fo:region-after just be blank space, or?

But at any rate, I think what you would like is another fo:page-sequence 
for the page that you want to have no header and footer.  Place it 
between two other fo:page-sequences with the normal fo:static-content 
information.

Glen

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


hide header/footer

Posted by Prakash R <ra...@yahoo.com>.
Is there a way to hide the header/footer for a
particular page within a page-sequence? I just want to
hide the header/footer for a particular page not the
last or any alternate page. I know there are ways to
do that. But is there a way to hide header/footer for
a random page in between?

Thank you.
Prakash


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: watermark

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Daniel Brown wrote:
> Thanks for your help so far. What I need is actually a watermark which 
> will be centered on all pages in the page sequence. I can get a watermark 
> on one page but not in all. Maybe I need to have even/odd pages and have a 
> block in each?

You should be able to set a background image for the body regions of
each and every simple page master you use. It may be necessary to use
a different image for different simple page masters in order to keep
the image centered. You can use a SVG as background image instead of
a bitmap, which might avoid bloating the result file.

The PDF file format has a specific mechanism for creating watermarks,
which is not used by FOP.


J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: watermark

Posted by Daniel Brown <Da...@binarytree.com>.
Thank you everyone. My solution was to use iText to add the watermark 
After the PDF is generated. It's the cleanest way to do it. If anyone 
wants any more info on this, let me know.

Regards,

Daniel




Louis.Masters@log-net.com 
10/05/2005 08:41 AM
Please respond to
fop-users@xmlgraphics.apache.org


To
fop-users@xmlgraphics.apache.org
cc

Subject
Re: watermark







Daniel: 

Just stick the template "call" into the body flow.  For example: 

<fo:flow flow-name="xsl-region-body"> 
        <fo:block-container position="absolute" top="10mm" left="1mm" 
height="70mm" width="230mm"> 
                <xsl:call-template name="showWatermark"> 
                        <xsl:with-param 
name="watermarkText"><xsl:apply-templates 
select="statusText"/></xsl:with-param> 
                </xsl:call-template> 
        </fo:block-container> 
        <xsl:apply-templates select="details/data"/> 
        <fo:block id="lastpage"></fo:block> 
</fo:flow> 

Better? 

-Lou 

Daniel Brown <Da...@binarytree.com> wrote on 10/05/2005 08:28:54:

> 
> Thanks for your help so far. What I need is actually a watermark 
> which will be centered on all pages in the page sequence. I can get 
> a watermark on one page but not in all. Maybe I need to have 
> even/odd pages and have a block in each? 
> 
> Daniel 
> 
> 

> 
> Louis.Masters@log-net.com 
> 10/05/2005 07:16 AM 
> 
> Please respond to
> fop-users@xmlgraphics.apache.org 
> 
> To 
> 
> fop-users@xmlgraphics.apache.org 
> 
> cc 
> 
> Subject 
> 
> Re: watermark 
> 
> 
> 
> 
> 
> Daniel: 
> 
> I do something like this with SVG to show the status of the document
> (draft, final, etc.).  However, transparency is not implemented yet 
> (at least not in 0.20.3) so I have to keep the SVG very unobtrusive 
> and colorless. 
> 
> Not sure if this helps much, but here is some XSL code: 
> 
> <xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform
> " xmlns:fo="http://www.w3.org/1999/XSL/Format"> 
> <xsl:template name="showWatermark"> 
> <xsl:param name="watermarkText"></xsl:param> 
>        <fo:block text-align="center"> 
>                <fo:instream-foreign-object xmlns:svg="http://www.w3.
> org/2000/svg"> 
>                        <svg:svg width="285" height="70"> 
>                                <svg:g transform="rotate(-5)"> 
>                                        <svg:text x="10" y="60" 
> style="font-family:Courier;font-size:40;font-weight:normal;stroke-
> width:0.5;fill:none;stroke:lightgray;stroke-opacity:0.75;"> 
>                                                <xsl:value-of 
> select="$watermarkText"/> 
>                                        </svg:text> 
>                                </svg:g> 
>                        </svg:svg> 
>                </fo:instream-foreign-object> 
>        </fo:block> 
> </xsl:template> 
> 
> <xsl:template name="showSmallWatermark"> 
> <xsl:param name="watermarkText"></xsl:param> 
>        <fo:block text-align="center"> 
>                <fo:instream-foreign-object xmlns:svg="http://www.w3.
> org/2000/svg"> 
>                        <svg:svg width="285" height="70"> 
>                                <svg:g transform="rotate(-3)"> 
>                                        <svg:text x="30" y="10" 
> style="font-family:Courier;font-size:30;font-weight:normal;stroke-
> width:0.5;fill:none;stroke:lightgray;"> 
>                                                <xsl:value-of 
> select="$watermarkText"/> 
>                                        </svg:text> 
>                                </svg:g> 
>                        </svg:svg> 
>                </fo:instream-foreign-object> 
>        </fo:block> 
> </xsl:template> 
> </xsl:stylesheet> 
> 
> 
> Then, to call it I do something like: 
> 
> <fo:block-container position="absolute" top="10mm" left="1mm" 
> height="70mm" width="230mm"> 
>        <xsl:call-template name="showWatermark"> 
>                <xsl:with-param name="watermarkText"><xsl:apply-
> templates select="statusText"/></xsl:with-param> 
>        </xsl:call-template> 
> </fo:block-container> 
> 
> 
> -Lou 
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> LOG-NET, Inc.
> The Logistics Network Management System
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 230 Half Mile Road
> Third Floor
> Red Bank, NJ 07701
> PH: 732-758-6800
> FAX: 732-747-7497
> http://www.LOG-NET.com
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> CONFIDENTIAL & PRIVILEGED
> Unless otherwise indicated or if obvious from the nature of the 
> content, the information contained herein is privileged and 
> confidential information/work product. The communication is intended
> for the use of the individual or entity named above.  If the reader 
> of this transmission is not the intended recipient, you are  hereby 
> notified that any dissemination, distribution or copying of this 
> communication is strictly prohibited.  If you have received this 
> communication in error, please notify the sender immediately by 
> telephone (732-758-6800) or by electronic mail (postmaster@LOG-NET.
> com), and destroy any copies, electronic, paper or otherwise, which 
> you may have of this communication.  Thank you.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
> 
> Daniel Brown <Da...@binarytree.com> wrote on 10/04/2005 17:11:55:
> 
> > 
> > How can I create a watermark? I've read the documentation/FAQ about 
> > watermarks. I need an Image which will fit being the center of the 
> > text on the page in the body and continue to remain centered on all 
> > the following pages in that sequence. 
> > 
> > Thank you, 
> > Daniel 

Re: watermark

Posted by Lo...@log-net.com.
Daniel:

Just stick the template "call" into the body flow.  For example:

<fo:flow flow-name="xsl-region-body">
        <fo:block-container position="absolute" top="10mm" left="1mm" 
height="70mm" width="230mm">
                <xsl:call-template name="showWatermark">
                        <xsl:with-param 
name="watermarkText"><xsl:apply-templates 
select="statusText"/></xsl:with-param>
                </xsl:call-template>
        </fo:block-container>
        <xsl:apply-templates select="details/data"/>
        <fo:block id="lastpage"></fo:block>
</fo:flow>

Better?

-Lou

Daniel Brown <Da...@binarytree.com> wrote on 10/05/2005 08:28:54:

> 
> Thanks for your help so far. What I need is actually a watermark 
> which will be centered on all pages in the page sequence. I can get 
> a watermark on one page but not in all. Maybe I need to have 
> even/odd pages and have a block in each? 
> 
> Daniel 
> 
> 

> 
> Louis.Masters@log-net.com 
> 10/05/2005 07:16 AM 
> 
> Please respond to
> fop-users@xmlgraphics.apache.org
> 
> To
> 
> fop-users@xmlgraphics.apache.org 
> 
> cc
> 
> Subject
> 
> Re: watermark
> 
> 
> 
> 
> 
> Daniel: 
> 
> I do something like this with SVG to show the status of the document
> (draft, final, etc.).  However, transparency is not implemented yet 
> (at least not in 0.20.3) so I have to keep the SVG very unobtrusive 
> and colorless. 
> 
> Not sure if this helps much, but here is some XSL code: 
> 
> <xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform
> " xmlns:fo="http://www.w3.org/1999/XSL/Format"> 
> <xsl:template name="showWatermark"> 
> <xsl:param name="watermarkText"></xsl:param> 
>        <fo:block text-align="center"> 
>                <fo:instream-foreign-object xmlns:svg="http://www.w3.
> org/2000/svg"> 
>                        <svg:svg width="285" height="70"> 
>                                <svg:g transform="rotate(-5)"> 
>                                        <svg:text x="10" y="60" 
> style="font-family:Courier;font-size:40;font-weight:normal;stroke-
> width:0.5;fill:none;stroke:lightgray;stroke-opacity:0.75;"> 
>                                                <xsl:value-of 
> select="$watermarkText"/> 
>                                        </svg:text> 
>                                </svg:g> 
>                        </svg:svg> 
>                </fo:instream-foreign-object> 
>        </fo:block> 
> </xsl:template> 
> 
> <xsl:template name="showSmallWatermark"> 
> <xsl:param name="watermarkText"></xsl:param> 
>        <fo:block text-align="center"> 
>                <fo:instream-foreign-object xmlns:svg="http://www.w3.
> org/2000/svg"> 
>                        <svg:svg width="285" height="70"> 
>                                <svg:g transform="rotate(-3)"> 
>                                        <svg:text x="30" y="10" 
> style="font-family:Courier;font-size:30;font-weight:normal;stroke-
> width:0.5;fill:none;stroke:lightgray;"> 
>                                                <xsl:value-of 
> select="$watermarkText"/> 
>                                        </svg:text> 
>                                </svg:g> 
>                        </svg:svg> 
>                </fo:instream-foreign-object> 
>        </fo:block> 
> </xsl:template> 
> </xsl:stylesheet> 
> 
> 
> Then, to call it I do something like: 
> 
> <fo:block-container position="absolute" top="10mm" left="1mm" 
> height="70mm" width="230mm"> 
>        <xsl:call-template name="showWatermark"> 
>                <xsl:with-param name="watermarkText"><xsl:apply-
> templates select="statusText"/></xsl:with-param> 
>        </xsl:call-template> 
> </fo:block-container> 
> 
> 
> -Lou 
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> LOG-NET, Inc.
> The Logistics Network Management System
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 230 Half Mile Road
> Third Floor
> Red Bank, NJ 07701
> PH: 732-758-6800
> FAX: 732-747-7497
> http://www.LOG-NET.com
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> CONFIDENTIAL & PRIVILEGED
> Unless otherwise indicated or if obvious from the nature of the 
> content, the information contained herein is privileged and 
> confidential information/work product. The communication is intended
> for the use of the individual or entity named above.  If the reader 
> of this transmission is not the intended recipient, you are  hereby 
> notified that any dissemination, distribution or copying of this 
> communication is strictly prohibited.  If you have received this 
> communication in error, please notify the sender immediately by 
> telephone (732-758-6800) or by electronic mail (postmaster@LOG-NET.
> com), and destroy any copies, electronic, paper or otherwise, which 
> you may have of this communication.  Thank you.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
> 
> Daniel Brown <Da...@binarytree.com> wrote on 10/04/2005 17:11:55:
> 
> > 
> > How can I create a watermark? I've read the documentation/FAQ about 
> > watermarks. I need an Image which will fit being the center of the 
> > text on the page in the body and continue to remain centered on all 
> > the following pages in that sequence. 
> > 
> > Thank you, 
> > Daniel 

Re: watermark

Posted by Daniel Brown <Da...@binarytree.com>.
Thanks for your help so far. What I need is actually a watermark which 
will be centered on all pages in the page sequence. I can get a watermark 
on one page but not in all. Maybe I need to have even/odd pages and have a 
block in each?

Daniel




Louis.Masters@log-net.com 
10/05/2005 07:16 AM
Please respond to
fop-users@xmlgraphics.apache.org


To
fop-users@xmlgraphics.apache.org
cc

Subject
Re: watermark







Daniel: 

I do something like this with SVG to show the status of the document 
(draft, final, etc.).  However, transparency is not implemented yet (at 
least not in 0.20.3) so I have to keep the SVG very unobtrusive and 
colorless. 

Not sure if this helps much, but here is some XSL code: 

<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" xmlns:fo="
http://www.w3.org/1999/XSL/Format"> 
<xsl:template name="showWatermark"> 
<xsl:param name="watermarkText"></xsl:param> 
        <fo:block text-align="center"> 
                <fo:instream-foreign-object xmlns:svg="
http://www.w3.org/2000/svg"> 
                        <svg:svg width="285" height="70"> 
                                <svg:g transform="rotate(-5)"> 
                                        <svg:text x="10" y="60" 
style="font-family:Courier;font-size:40;font-weight:normal;stroke-width:0.5;fill:none;stroke:lightgray;stroke-opacity:0.75;"> 

                                                <xsl:value-of 
select="$watermarkText"/> 
                                        </svg:text> 
                                </svg:g> 
                        </svg:svg> 
                </fo:instream-foreign-object> 
        </fo:block> 
</xsl:template> 

<xsl:template name="showSmallWatermark"> 
<xsl:param name="watermarkText"></xsl:param> 
        <fo:block text-align="center"> 
                <fo:instream-foreign-object xmlns:svg="
http://www.w3.org/2000/svg"> 
                        <svg:svg width="285" height="70"> 
                                <svg:g transform="rotate(-3)"> 
                                        <svg:text x="30" y="10" 
style="font-family:Courier;font-size:30;font-weight:normal;stroke-width:0.5;fill:none;stroke:lightgray;"> 

                                                <xsl:value-of 
select="$watermarkText"/> 
                                        </svg:text> 
                                </svg:g> 
                        </svg:svg> 
                </fo:instream-foreign-object> 
        </fo:block> 
</xsl:template> 
</xsl:stylesheet> 


Then, to call it I do something like: 

<fo:block-container position="absolute" top="10mm" left="1mm" 
height="70mm" width="230mm"> 
        <xsl:call-template name="showWatermark"> 
                <xsl:with-param name="watermarkText"><xsl:apply-templates 
select="statusText"/></xsl:with-param> 
        </xsl:call-template> 
</fo:block-container> 


-Lou 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOG-NET, Inc.
The Logistics Network Management System
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230 Half Mile Road
Third Floor
Red Bank, NJ 07701
PH: 732-758-6800
FAX: 732-747-7497
http://www.LOG-NET.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CONFIDENTIAL & PRIVILEGED
Unless otherwise indicated or if obvious from the nature of the content, 
the information contained herein is privileged and confidential 
information/work product. The communication is intended for the use of the 
individual or entity named above.  If the reader of this transmission is 
not the intended recipient, you are  hereby notified that any 
dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please 
notify the sender immediately by telephone (732-758-6800) or by electronic 
mail (postmaster@LOG-NET.com), and destroy any copies, electronic, paper 
or otherwise, which you may have of this communication.  Thank you.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

Daniel Brown <Da...@binarytree.com> wrote on 10/04/2005 17:11:55:

> 
> How can I create a watermark? I've read the documentation/FAQ about 
> watermarks. I need an Image which will fit being the center of the 
> text on the page in the body and continue to remain centered on all 
> the following pages in that sequence. 
> 
> Thank you, 
> Daniel

Re: watermark

Posted by Lo...@log-net.com.
Daniel:

I do something like this with SVG to show the status of the document 
(draft, final, etc.).  However, transparency is not implemented yet (at 
least not in 0.20.3) so I have to keep the SVG very unobtrusive and 
colorless.

Not sure if this helps much, but here is some XSL code:

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template name="showWatermark">
<xsl:param name="watermarkText"></xsl:param>
        <fo:block text-align="center">
                <fo:instream-foreign-object 
xmlns:svg="http://www.w3.org/2000/svg">
                        <svg:svg width="285" height="70">
                                <svg:g transform="rotate(-5)">
                                        <svg:text x="10" y="60" 
style="font-family:Courier;font-size:40;font-weight:normal;stroke-width:0.5;fill:none;stroke:lightgray;stroke-opacity:0.75;">
                                                <xsl:value-of 
select="$watermarkText"/>
                                        </svg:text>
                                </svg:g>
                        </svg:svg>
                </fo:instream-foreign-object>
        </fo:block>
</xsl:template>

<xsl:template name="showSmallWatermark">
<xsl:param name="watermarkText"></xsl:param>
        <fo:block text-align="center">
                <fo:instream-foreign-object 
xmlns:svg="http://www.w3.org/2000/svg">
                        <svg:svg width="285" height="70">
                                <svg:g transform="rotate(-3)">
                                        <svg:text x="30" y="10" 
style="font-family:Courier;font-size:30;font-weight:normal;stroke-width:0.5;fill:none;stroke:lightgray;">
                                                <xsl:value-of 
select="$watermarkText"/>
                                        </svg:text>
                                </svg:g>
                        </svg:svg>
                </fo:instream-foreign-object>
        </fo:block>
</xsl:template>
</xsl:stylesheet>


Then, to call it I do something like:

<fo:block-container position="absolute" top="10mm" left="1mm" 
height="70mm" width="230mm">
        <xsl:call-template name="showWatermark">
                <xsl:with-param name="watermarkText"><xsl:apply-templates 
select="statusText"/></xsl:with-param>
        </xsl:call-template>
</fo:block-container>


-Lou

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOG-NET, Inc.
The Logistics Network Management System
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230 Half Mile Road
Third Floor
Red Bank, NJ 07701
PH: 732-758-6800
FAX: 732-747-7497
http://www.LOG-NET.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CONFIDENTIAL & PRIVILEGED
Unless otherwise indicated or if obvious from the nature of the content, 
the information contained herein is privileged and confidential 
information/work product. The communication is intended for the use of the 
individual or entity named above.  If the reader of this transmission is 
not the intended recipient, you are  hereby notified that any 
dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please 
notify the sender immediately by telephone (732-758-6800) or by electronic 
mail (postmaster@LOG-NET.com), and destroy any copies, electronic, paper 
or otherwise, which you may have of this communication.  Thank you.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Daniel Brown <Da...@binarytree.com> wrote on 10/04/2005 17:11:55:

> 
> How can I create a watermark? I've read the documentation/FAQ about 
> watermarks. I need an Image which will fit being the center of the 
> text on the page in the body and continue to remain centered on all 
> the following pages in that sequence. 
> 
> Thank you, 
> Daniel