Re: add watermark to generated PDF using FOP

2004-04-21 Thread Louis . Masters

Just some sample code for using SVG for a watermark:

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

-Lou




 
  Clay Leeds
 
  [EMAIL PROTECTED] To:  [EMAIL PROTECTED] 
 
  om  cc:  
 
   Subject: Re: add watermark to 
generated PDF using FOP 
  04/16/2004 16:37  
 
  Please respond
 
  to fop-user   
 

 

 



On Apr 16, 2004, at 1:22 PM, David Beck wrote:
 I used FOP and JAI to render PDF.  I did not use configuration
 class to set baseDir. In my case, do you think if there is a way
 to pass this draft.jpg image into XSL and display it on each pdf
 as background? Or can I use fo:external-graphic src=...
 inside /fo:region-body or use transformer.setParameterto refer
 to this draft image?

 thanks,


 Jerry

I thought this would be in the FAQ, but it's not there (yet ;-) )

http://xml.apache.org/fop/output.html#pdf-postprocess
http://xml.apache.org/fop/output.html#pdf-watermark

Clay Leeds - [EMAIL PROTECTED]
--
Web Developer - Medata, Inc. - http://www.medata.com/
PGP Public Key: https://mail.medata.com/pgp/cleeds.asc


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







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



Re: Re: add watermark to generated PDF using FOP

2004-04-19 Thread David Beck
 
 I thought this would be in the FAQ, but it's not there (yet
;-) )
 
 http://xml.apache.org/fop/output.html#pdf-postprocess
 http://xml.apache.org/fop/output.html#pdf-watermark

Yes, seems like FOP does not support watermark. My colleague
told me that iText can do that. I will take a look at iText.

regards,

Dave

 
 Clay Leeds - [EMAIL PROTECTED]



Get your own 800 number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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



add watermark to generated PDF using FOP

2004-04-16 Thread David Beck
Good Friday!

I have a problem with adding watermark. Hopefully someone can
help me with this.

I use FOP and xsl to display a tiff image with multipage in PDF
format in the browser. I have done this part. Now what I need is
that I want to add a watermark(say, COPY ONLY or SAMPLE) to each
generated PDF before I display them in the browser. So,when
users view those PDFs in browser, the watermark appears either
as foreground or background to protect those images from being
stolen.

Can I do something directly in XSL file? or I have to use FOP to
do this task? I searched our archives and haven't got an answer
yet. Does anyone have this experience? Any help will be
appreciated. Thanks a lot.

Dave 




Get your own 800 number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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



RE: add watermark to generated PDF using FOP

2004-04-16 Thread Koes, Derrick

I use a watermark for generated draft pdf documents.
I accomplished this with a background image, which isn't a true watermark,
but is adequate for the purpose.

Snip...

fo:simple-page-master master-name=formal xsl:use-attribute-sets=master
fo:region-body margin-top=2.8in margin-bottom=0.75in
xsl:if test=$status = 'draft'
xsl:attribute name=background-image
xsl:textdraft.jpg/xsl:text
/xsl:attribute
/xsl:if
/fo:region-body

If you need an overlay on the image itself, you'll like need to use svg.  We
did this to annotate images with shapes and text.

Derrick




-Original Message-
From: David Beck [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 16, 2004 1:07 PM
To: [EMAIL PROTECTED]
Subject: add watermark to generated PDF using FOP

Good Friday!

I have a problem with adding watermark. Hopefully someone can
help me with this.

I use FOP and xsl to display a tiff image with multipage in PDF
format in the browser. I have done this part. Now what I need is
that I want to add a watermark(say, COPY ONLY or SAMPLE) to each
generated PDF before I display them in the browser. So,when
users view those PDFs in browser, the watermark appears either
as foreground or background to protect those images from being
stolen.

Can I do something directly in XSL file? or I have to use FOP to
do this task? I searched our archives and haven't got an answer
yet. Does anyone have this experience? Any help will be
appreciated. Thanks a lot.

Dave 




Get your own 800 number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
This electronic transmission is strictly confidential to Smith  Nephew and
intended solely for the addressee.  It may contain information which is
covered by legal, professional or other privilege.  If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy or take any action in reliance on this
transmission.  If you have received this transmission in error, please
notify the sender as soon as possible and destroy this message.

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



Re: RE: add watermark to generated PDF using FOP

2004-04-16 Thread David Beck
Derrick,

Thanks for your info. I am quite new to XSL. So, just bear with
me. You use the element xsl:text to refer to an external
image. I do not know exactly how it works. Would you please tell
me how to refer to an external image using the following snip
codes given the image watermark_draft.gif which is stored int
the directory C:/image/ ? 

thanks,

Dave

fo:layout-master-set
fo:simple-page-master page-width=21cm
page-height=29.7cm master-name=left

fo:region-body margin-top=1cm margin-bottom=1cm
  xsl:attribute name=background-image   
xsl:textwatermark_draft.gif/xsl:text
/xsl:attribute
/fo:region-body

 /fo:simple-page-master
/fo:layout-master-set





 On Fri, 16 Apr 2004, Koes, Derrick
([EMAIL PROTECTED]) wrote:

 
 I use a watermark for generated draft pdf documents.
 I accomplished this with a background image, which isn't a
true watermark,
 but is adequate for the purpose.
 
 Snip...
 
 fo:simple-page-master master-name=formal
xsl:use-attribute-sets=master
 fo:region-body margin-top=2.8in margin-bottom=0.75in
 xsl:if test=$status = 'draft'
 xsl:attribute name=background-image
 xsl:textdraft.jpg/xsl:text
 /xsl:attribute
 /xsl:if
 /fo:region-body
 
 If you need an overlay on the image itself, you'll like need
to use svg.  We
 did this to annotate images with shapes and text.
 
 Derrick
 
 
 
 
 -Original Message-
 From: David Beck [mailto:[EMAIL PROTECTED] 
 Sent: Friday, April 16, 2004 1:07 PM
 To: [EMAIL PROTECTED]
 Subject: add watermark to generated PDF using FOP
 
 Good Friday!
 
 I have a problem with adding watermark. Hopefully someone can
 help me with this.
 
 I use FOP and xsl to display a tiff image with multipage in
PDF
 format in the browser. I have done this part. Now what I need
is
 that I want to add a watermark(say, COPY ONLY or SAMPLE) to
each
 generated PDF before I display them in the browser. So,when
 users view those PDFs in browser, the watermark appears either
 as foreground or background to protect those images from being
 stolen.
 
 Can I do something directly in XSL file? or I have to use FOP
to
 do this task? I searched our archives and haven't got an
answer
 yet. Does anyone have this experience? Any help will be
 appreciated. Thanks a lot.
 
 Dave 
 
 
 
 
 Get your own 800 number
 Voicemail, fax, email, and a lot more
 http://www.ureach.com/reg/tag
 

-
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 This electronic transmission is strictly confidential to Smith
 Nephew and
 intended solely for the addressee.  It may contain information
which is
 covered by legal, professional or other privilege.  If you are
not the
 intended addressee, or someone authorized by the intended
addressee to
 receive transmissions on behalf of the addressee, you must not
retain,
 disclose in any form, copy or take any action in reliance on
this
 transmission.  If you have received this transmission in
error, please
 notify the sender as soon as possible and destroy this
message.
 

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



Get your own 800 number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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



RE: RE: add watermark to generated PDF using FOP

2004-04-16 Thread Koes, Derrick
We use the FOP driver class to accomplish pdf creation.  The Configuration
class allows us to set the baseDir property for external images.  Below is
another code snippet that shows how we do this.

The String baseDir would contain something like, C:/images;
If this directory had an image called draft.jpg in it, such as in my first
code snippet, the image would be rendered in the pdf.


myDriver = new Driver();

//  Tell the FOP Driver what logger to use.
//  This must be done in the order it is here.
Log4JLogger log4j = new Log4JLogger(dora);
MessageHandler.setScreenLogger(log4j);
myDriver.setLogger(log4j);

//  What other kinds can be rendered?
//  AWT, MIF, PCL, PDF, PRINT, PS, SVG, TXT, XML
myDriver.setRenderer(Driver.RENDER_PDF);

Configuration.put(baseDir, baseDir);
InputSource is = new InputSource(fo);
myDriver.setInputSource(is);
myDriver.setOutputStream(pdf);
myDriver.run();



/**
 * Contact information.
 */
public class INFO
{
static final String NAME = Derrick Koes;
String title = Senior Software Engineer;
String company = Smith  Nephew Endoscopy;
URL companyURL = new URL(
http://www.smith-nephew.com/index-flash.html;);
String aolIM = codeauthor2001;
String EMAIL = [EMAIL PROTECTED];
String PHONE = (978) 474-6302;
String FAX = (978) 749-1487;
String QUOTE = No, try not, do or do not, there is no try.
}
 

-Original Message-
From: David Beck [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 16, 2004 3:35 PM
To: Koes, Derrick
Subject: Re: RE: add watermark to generated PDF using FOP

Derrick,

Thanks for your info. I am quite new to XSL. So, just bear with
me. You use the element xsl:text to refer to an external
image. I do not know exactly how it works. Would you please tell
me how to refer to an external image using the following snip
codes given the image watermark_draft.gif which is stored int
the directory C:/image/ ? 

thanks,

Dave

fo:layout-master-set
fo:simple-page-master page-width=21cm
page-height=29.7cm master-name=left

fo:region-body margin-top=1cm margin-bottom=1cm
  xsl:attribute name=background-image   
xsl:textwatermark_draft.gif/xsl:text
/xsl:attribute
/fo:region-body

 /fo:simple-page-master
/fo:layout-master-set





 On Fri, 16 Apr 2004, Koes, Derrick
([EMAIL PROTECTED]) wrote:

 
 I use a watermark for generated draft pdf documents.
 I accomplished this with a background image, which isn't a
true watermark,
 but is adequate for the purpose.
 
 Snip...
 
 fo:simple-page-master master-name=formal
xsl:use-attribute-sets=master
 fo:region-body margin-top=2.8in margin-bottom=0.75in
 xsl:if test=$status = 'draft'
 xsl:attribute name=background-image
 xsl:textdraft.jpg/xsl:text
 /xsl:attribute
 /xsl:if
 /fo:region-body
 
 If you need an overlay on the image itself, you'll like need
to use svg.  We
 did this to annotate images with shapes and text.
 
 Derrick
 
 
 
 
 -Original Message-
 From: David Beck [mailto:[EMAIL PROTECTED] 
 Sent: Friday, April 16, 2004 1:07 PM
 To: [EMAIL PROTECTED]
 Subject: add watermark to generated PDF using FOP
 
 Good Friday!
 
 I have a problem with adding watermark. Hopefully someone can
 help me with this.
 
 I use FOP and xsl to display a tiff image with multipage in
PDF
 format in the browser. I have done this part. Now what I need
is
 that I want to add a watermark(say, COPY ONLY or SAMPLE) to
each
 generated PDF before I display them in the browser. So,when
 users view those PDFs in browser, the watermark appears either
 as foreground or background to protect those images from being
 stolen.
 
 Can I do something directly in XSL file? or I have to use FOP
to
 do this task? I searched our archives and haven't got an
answer
 yet. Does anyone have this experience? Any help will be
 appreciated. Thanks a lot.
 
 Dave 
 
 
 
 
 Get your own 800 number
 Voicemail, fax, email, and a lot more
 http://www.ureach.com/reg/tag
 

-
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 This electronic transmission is strictly confidential to Smith
 Nephew and
 intended solely for the addressee.  It may contain information
which is
 covered by legal, professional or other privilege.  If you are
not the
 intended addressee, or someone authorized by the intended
addressee to
 receive transmissions on behalf of the addressee, you must not
retain,
 disclose in any form, copy or take any action in reliance on
this
 transmission.  If you have received this transmission in
error, please
 notify the sender as soon as possible and destroy this
message.
 

-
 To unsubscribe, e-mail: [EMAIL PROTECTED

RE: RE: add watermark to generated PDF using FOP

2004-04-16 Thread David Beck
I used FOP and JAI to render PDF.  I did not use configuration
class to set baseDir. In my case, do you think if there is a way
to pass this draft.jpg image into XSL and display it on each pdf
as background? Or can I use fo:external-graphic src=... 
inside /fo:region-body or use transformer.setParameterto refer
to this draft image?

thanks,


Jerry 



 On Fri, 16 Apr 2004, Koes, Derrick
([EMAIL PROTECTED]) wrote:

 We use the FOP driver class to accomplish pdf creation.  The
Configuration
 class allows us to set the baseDir property for external
images.  Below is
 another code snippet that shows how we do this.
 
 The String baseDir would contain something like, C:/images;
 If this directory had an image called draft.jpg in it, such as
in my first
 code snippet, the image would be rendered in the pdf.
 
 
 myDriver = new Driver();
 
 //  Tell the FOP Driver what logger to use.
 //  This must be done in the order it is here.
 Log4JLogger log4j = new Log4JLogger(dora);
 MessageHandler.setScreenLogger(log4j);
 myDriver.setLogger(log4j);
 
 //  What other kinds can be rendered?
 //  AWT, MIF, PCL, PDF, PRINT, PS, SVG, TXT, XML
 myDriver.setRenderer(Driver.RENDER_PDF);
 
 Configuration.put(baseDir, baseDir);
 InputSource is = new InputSource(fo);
 myDriver.setInputSource(is);
 myDriver.setOutputStream(pdf);
 myDriver.run();
 
 
 
 /**
  * Contact information.
  */
 public class INFO
 {
 static final String NAME = Derrick Koes;
 String title = Senior Software Engineer;
 String company = Smith  Nephew Endoscopy;
 URL companyURL = new URL(
 http://www.smith-nephew.com/index-flash.html;);
 String aolIM = codeauthor2001;
 String EMAIL = [EMAIL PROTECTED];
 String PHONE = (978) 474-6302;
 String FAX = (978) 749-1487;
 String QUOTE = No, try not, do or do not, there is no
try.
 }
  
 
 -Original Message-
 From: David Beck [mailto:[EMAIL PROTECTED] 
 Sent: Friday, April 16, 2004 3:35 PM
 To: Koes, Derrick
 Subject: Re: RE: add watermark to generated PDF using FOP
 
 Derrick,
 
 Thanks for your info. I am quite new to XSL. So, just bear
with
 me. You use the element xsl:text to refer to an external
 image. I do not know exactly how it works. Would you please
tell
 me how to refer to an external image using the following snip
 codes given the image watermark_draft.gif which is stored int
 the directory C:/image/ ? 
 
 thanks,
 
 Dave
 
 fo:layout-master-set
 fo:simple-page-master page-width=21cm
 page-height=29.7cm master-name=left
   
   fo:region-body margin-top=1cm margin-bottom=1cm
 xsl:attribute name=background-image   
   xsl:textwatermark_draft.gif/xsl:text
   /xsl:attribute
   /fo:region-body
   
  /fo:simple-page-master
 /fo:layout-master-set
 
 
 
 
 
  On Fri, 16 Apr 2004, Koes, Derrick
 ([EMAIL PROTECTED]) wrote:
 
  
  I use a watermark for generated draft pdf documents.
  I accomplished this with a background image, which isn't a
 true watermark,
  but is adequate for the purpose.
  
  Snip...
  
  fo:simple-page-master master-name=formal
 xsl:use-attribute-sets=master
  fo:region-body margin-top=2.8in
margin-bottom=0.75in
  xsl:if test=$status = 'draft'
  xsl:attribute name=background-image
  xsl:textdraft.jpg/xsl:text
  /xsl:attribute
  /xsl:if
  /fo:region-body
  
  If you need an overlay on the image itself, you'll like need
 to use svg.  We
  did this to annotate images with shapes and text.
  
  Derrick
  
  
  
  
  -Original Message-
  From: David Beck [mailto:[EMAIL PROTECTED] 
  Sent: Friday, April 16, 2004 1:07 PM
  To: [EMAIL PROTECTED]
  Subject: add watermark to generated PDF using FOP
  
  Good Friday!
  
  I have a problem with adding watermark. Hopefully someone
can
  help me with this.
  
  I use FOP and xsl to display a tiff image with multipage in
 PDF
  format in the browser. I have done this part. Now what I
need
 is
  that I want to add a watermark(say, COPY ONLY or SAMPLE) to
 each
  generated PDF before I display them in the browser. So,when
  users view those PDFs in browser, the watermark appears
either
  as foreground or background to protect those images from
being
  stolen.
  
  Can I do something directly in XSL file? or I have to use
FOP
 to
  do this task? I searched our archives and haven't got an
 answer
  yet. Does anyone have this experience? Any help will be
  appreciated. Thanks a lot.
  
  Dave 
  
  
  
  
  Get your own 800 number
  Voicemail, fax, email, and a lot more
  http://www.ureach.com/reg/tag
  
 

-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail:
[EMAIL PROTECTED]
  This electronic transmission is strictly confidential to
Smith
  Nephew and
  intended solely for the addressee.  It may

Re: add watermark to generated PDF using FOP

2004-04-16 Thread Clay Leeds
On Apr 16, 2004, at 1:22 PM, David Beck wrote:
I used FOP and JAI to render PDF.  I did not use configuration
class to set baseDir. In my case, do you think if there is a way
to pass this draft.jpg image into XSL and display it on each pdf
as background? Or can I use fo:external-graphic src=...
inside /fo:region-body or use transformer.setParameterto refer
to this draft image?
thanks,
Jerry
I thought this would be in the FAQ, but it's not there (yet ;-) )
http://xml.apache.org/fop/output.html#pdf-postprocess
http://xml.apache.org/fop/output.html#pdf-watermark
Clay Leeds - [EMAIL PROTECTED]
--
Web Developer - Medata, Inc. - http://www.medata.com/
PGP Public Key: https://mail.medata.com/pgp/cleeds.asc
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Re: [list_fop_user] Re: RE: add watermark to generated PDF using FOP

2004-04-16 Thread David Beck
Matt,

We just tried the following:

fo:layout-master-set
fo:simple-page-master margin-right=1.5cm
margin-left=1.5cm margin-bottom=3cm margin-top=1.5cm
page-width=20cm page-height=28cm master-name=left

fo:region-body margin-top=1cm margin-bottom=1cm
   xsl:attribute name=background-image  
 xsl:textfile:///c:/image/watermark_draft.gif/xsl:text
   /xsl:attribute
/fo:region-body
...

Part of the Draft image appeared(not the whole image), but the
position is not right. There are two of the same draft images
and they are right at the bottom of each page and seperate from
the pdf content. Something wrong with the position. I changed
the width and height and no big difference. Do you have any idea
about it?

thanks,


Dave 




Get your own 800 number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag


 On Fri, 16 Apr 2004, Matt Healy ([EMAIL PROTECTED]) wrote:

 At 03:34 PM 16-04-04, it's rumored that David Beck said:
 Would you please tell me how to refer to an external image
using the 
 following snip codes given the image watermark_draft.gif
which is stored 
 int the directory C:/image/ ?
 
 I think you should be OK if you replace the region-body
definition with 
 something like the following:
 
 [snip]
  fo:region-body margin-top=1cm margin-bottom=1cm
xsl:attribute name=background-image
 
xsl:textfile:///c:/image/watermark_draft.gif/xsl:text
  /xsl:attribute
  /fo:region-body
 [snip]
 
 -mjh
 --
 Matthew J. Healy
 Department of Computer Science, RIT
 102 Lomb Memorial Drive, Rochester, NY  14623
 mailto:[EMAIL PROTECTED]
 http://www.cs.rit.edu/~mjh
 Voice:  (585) 248-3425
 
 
 

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


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