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 Johannes Wolfgang Woger <wo...@syslog.at> on 2004/09/24 13:41:03 UTC

PDF: no border, file name

Hi,
my gernerated pdf file which I download form my printServlet, does not show any
border:
    <fo:region-body border="solid 2pt red"/>
is without effect.

My second question: In my printServlet I take the OutputSream form the response
and give it to the driver:
    OutputStream out = response.getOutputStream();
    driver.setOutputStream(out);
How can I set a name for the file to be downloaded. The name I get is the name of
the Servlet (vertually Struts Action) that is invoked by the print button or print link, 
without any file extension.
So its name is somePrintPrepareAction instead of myPrintWorthFile.pdf.
Some suggestions ?

Wolfgang

AW: AW: PDF: no border, file name

Posted by Sascha Schmidt <co...@northbit.de>.
Uups, my mistake. But I wonder why border attributes are defined for
fo:region-body but must be 0.?

Sascha

 
-----Ursprüngliche Nachricht-----
Von: Jeremias Maerki [mailto:dev.jeremias@greenmail.ch] 
Gesendet: Sonntag, 26. September 2004 22:31
An: fop-user@xml.apache.org
Betreff: Re: AW: PDF: no border, file name

It is true that border attributes are defined for fo:region-body but if
you read the whole chapter 6.4.13, you will find the following sentence:

"In version 1.0 of this Recommendation, the values of the padding and
border-width traits must be "0"."

This has the effect that fo:region-body may not have a border (if I read
that correctly).

On 26.09.2004 21:02:30 Sascha Schmidt wrote:
> Just want to say, that IMHO the spec allows border attributes for
> fo:region-body. See here:
> 
> http://www.w3.org/TR/2001/REC-xsl-20011015/slice6.html#fo_region-body 
> 
> "
> ... The following properties apply to this formatting object
> (fo:region-body): 
> 
> [7.7 Common Border, Padding, and Background Properties] 
> [7.10 Common Margin Properties-Block] 
> [7.20.1 "clip"] 
> [7.25.2 "column-count"] 
> [7.25.3 "column-gap"] 
> [7.13.4 "display-align"] 
> [7.20.2 "overflow"] 
> [7.25.17 "region-name"] 
> [7.20.3 "reference-orientation"] 
> [7.27.7 "writing-mode"] 
> "


Jeremias Maerki


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



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


Re: AW: PDF: no border, file name

Posted by Jeremias Maerki <de...@greenmail.ch>.
It is true that border attributes are defined for fo:region-body but if
you read the whole chapter 6.4.13, you will find the following sentence:

"In version 1.0 of this Recommendation, the values of the padding and border-width traits must be "0"."

This has the effect that fo:region-body may not have a border (if I read
that correctly).

On 26.09.2004 21:02:30 Sascha Schmidt wrote:
> Just want to say, that IMHO the spec allows border attributes for
> fo:region-body. See here:
> 
> http://www.w3.org/TR/2001/REC-xsl-20011015/slice6.html#fo_region-body 
> 
> "
> ... The following properties apply to this formatting object
> (fo:region-body): 
> 
> [7.7 Common Border, Padding, and Background Properties] 
> [7.10 Common Margin Properties-Block] 
> [7.20.1 "clip"] 
> [7.25.2 "column-count"] 
> [7.25.3 "column-gap"] 
> [7.13.4 "display-align"] 
> [7.20.2 "overflow"] 
> [7.25.17 "region-name"] 
> [7.20.3 "reference-orientation"] 
> [7.27.7 "writing-mode"] 
> "


Jeremias Maerki


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


AW: PDF: no border, file name

Posted by Sascha Schmidt <co...@northbit.de>.
Hello!

Just want to say, that IMHO the spec allows border attributes for
fo:region-body. See here:

http://www.w3.org/TR/2001/REC-xsl-20011015/slice6.html#fo_region-body 

"
... The following properties apply to this formatting object
(fo:region-body): 

[7.7 Common Border, Padding, and Background Properties] 
[7.10 Common Margin Properties-Block] 
[7.20.1 "clip"] 
[7.25.2 "column-count"] 
[7.25.3 "column-gap"] 
[7.13.4 "display-align"] 
[7.20.2 "overflow"] 
[7.25.17 "region-name"] 
[7.20.3 "reference-orientation"] 
[7.27.7 "writing-mode"] 
"


Cheers,
Sascha

 
-----Ursprüngliche Nachricht-----
Von: J.Pietschmann [mailto:j3322ptm@yahoo.de] 
Gesendet: Samstag, 25. September 2004 00:19
An: fop-user@xml.apache.org
Betreff: Re: PDF: no border, file name

Johannes Wolfgang Woger wrote:
> my gernerated pdf file which I download form my printServlet, does not 
> show any
> border:
>     <fo:region-body border="solid 2pt red"/>
> is without effect.

The spec forbids this, and FOP 0.20.5 complies. The usual way to
get a border around the body region is to use a background image
or put appropriate block containers with approproate border settings
into the static content areas.

> How can I set a name for the file to be downloaded.

The usual way is to send a MIME-multipart response, and send the
PDF either as file attachment or using a content-disposition
header. Search the list archive for sample code.

J.Pietschmann

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


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


Re: PDF: no border, file name

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Johannes Wolfgang Woger wrote:
> my gernerated pdf file which I download form my printServlet, does not 
> show any
> border:
>     <fo:region-body border="solid 2pt red"/>
> is without effect.

The spec forbids this, and FOP 0.20.5 complies. The usual way to
get a border around the body region is to use a background image
or put appropriate block containers with approproate border settings
into the static content areas.

> How can I set a name for the file to be downloaded.

The usual way is to send a MIME-multipart response, and send the
PDF either as file attachment or using a content-disposition
header. Search the list archive for sample code.

J.Pietschmann

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


Re: no border, file name

Posted by John Burgess <jo...@riskdecisions.com>.
set the mapping for the servlet to be 
myPrintWorthFile.pdf

i.e. in web.xml

....
<servlet>
    <servlet-name>foo</servlet-name>
    <servlet-class>com.woger.foo</servlet-clas>
</servlet>
.....
<servlet-mapping>
    <servlet-name>foo</servlet-name>
    <url-pattern>/myPrintWorthFile.pdf</url-pattern>
 </servlet-mapping>


This has the additional advantage of helping retarded browsers (IE 4 anyone?) realise that you are sending a pdf file.  Most should be fine with anyname as long as you set the mime type but having a .pdf extension can help.
  ----- Original Message ----- 
  From: Johannes Wolfgang Woger 
  To: FOP 
  Sent: Friday, September 24, 2004 12:41 PM
  Subject: PDF: no border, file name


  Hi,
  my gernerated pdf file which I download form my printServlet, does not show any
  border:
      <fo:region-body border="solid 2pt red"/>
  is without effect.
   
  My second question: In my printServlet I take the OutputSream form the response
  and give it to the driver:
      OutputStream out = response.getOutputStream();
      driver.setOutputStream(out);
  How can I set a name for the file to be downloaded. The name I get is the name of
  the Servlet (vertually Struts Action) that is invoked by the print button or print link, 
  without any file extension.
  So its name is somePrintPrepareAction instead of myPrintWorthFile.pdf.
  Some suggestions ?
   
  Wolfgang


  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.762 / Virus Database: 510 - Release Date: 16/09/04

Re: PDF: no border, file name

Posted by Johannes Wolfgang Woger <wo...@syslog.at>.
----- Original Message ----- 
From: "Clay Leeds" <cl...@medata.com>
To: <fo...@xml.apache.org>
Sent: Friday, September 24, 2004 4:45 PM
Subject: Re: PDF: no border, file name


> 
> On Sep 24, 2004, at 4:41 AM, Johannes Wolfgang Woger wrote:
> > Hi,
> >
> > my gernerated pdf file which I download form my printServlet, does not 
> > show any
> >
> > border:
> >
> > <fo:region-body border="solid 2pt red"/>
> >
> > is without effect.
> 
> I don't know if this is it, but I always write mine as:
> 
> <fo:region-body border="2pt solid red"/>
> 
> Wait a minute. I don't know if you can add a @border to region-body. 
> Can you place the border on a child fo:block of region-body?
> 
> <fo:region-body>
> <fo:block border="2pt solid red"/>
You are right, border seems belongs into the <fo:block  tag.
I have a book, not FOP-spezific but XSL-FO specific which tolt me to put
border elsewhere.
Thank you.

Wolfgang
> </fo:block>
> </fo:region-body>
> 
> I can't help with the 2nd question.
> 
> Web Maestro Clay
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
> 

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


Re: PDF: no border, file name

Posted by Clay Leeds <cl...@medata.com>.
On Sep 24, 2004, at 4:41 AM, Johannes Wolfgang Woger wrote:
> Hi,
>
> my gernerated pdf file which I download form my printServlet, does not 
> show any
>
> border:
>
>     <fo:region-body border="solid 2pt red"/>
>
> is without effect.

I don't know if this is it, but I always write mine as:

<fo:region-body border="2pt solid red"/>

Wait a minute. I don't know if you can add a @border to region-body. 
Can you place the border on a child fo:block of region-body?

<fo:region-body>
<fo:block border="2pt solid red"/>
...
</fo:block>
</fo:region-body>

I can't help with the 2nd question.

Web Maestro Clay


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