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 MARTIN Franck <fr...@c-s.fr> on 2002/04/04 11:10:48 UTC

Drawing a border around a simple word

Hi all

Does anyone know how to draw a border around a word placed in a
sentence?

I would appreciate any suggestion very much ;)

Franck


Re: Drawing a border around a simple word

Posted by "J.Pietschmann" <j3...@yahoo.de>.
MARTIN Franck wrote:
> Does anyone know how to draw a border around a word placed in a
> sentence?

The only solution working in FOP 0.20.3 seems to be to use
an SVG, something like:
  <fo:instream-foreign-object>
    <svg:svg xmlns:svg="..." height="12pt" width="14em">
      <svg:rect x="0" y="0" height="12pt" width="24em"/>
      <svg:text style="font-family: sans-serif;">Bordered stuff</svg:text>
    </svg:svg>
  </fo:instream-foreign-object>

Complete with the missing SVG namespace and fiddle a bit
with the values.

Better ways have already been suggested, for example using
fo:inline and specifying a border, but unfortunately, most
non-font properties on fo:inline are currently unimplemented.

J.Pietschmann





Re: Drawing a border around a simple word

Posted by Josh Campbell <jo...@zype.co.nz>.
>
>
>As a matter of fact the XSL:FO specification allows border attributes for the
>inline element which apparently is not supported by FOP.
>I thought they're might be a work around to draw a border around a word placed in
>a sentence. Maybe someone successfully overcame that obstacle... If so, i would
>appreciate some help very much...
>
I haven't tested this but it may work. Try nesting two inline styles and 
use background colours and padding/margins to define the border.
ie. the first style with a black background, the second (inner) style 
with a background that matches your page background and margins to hold 
it in the required border width.

Here's an example. The margin syntax may be wrong, it's early morning 
and I can't remember what it's meant to look like. I'd be interested if 
this works.

<fo:inline background-color="#000000">
<fo:inline background-color="#ffffff" margin-width="0.5cm">
Text in here
</fo:inline>
</fo:inline>


Josh Campbell

ZYPE - Graphical Interface Design
Phone: 03 3862094
Mobile: 021 400 472
Web: www.zype.co.nz




Re: Fopping and batch printing

Posted by Jeremias Maerki <je...@outline.ch>.
(comments inline)

On 22.04.2002 14:29:04 Wayne Elliott wrote:
> Howdy
> 
> Anyone know of the best way to batch FOP generated PDF
> documents for printing. In our scenario documents are
> queued for generation, followed by printing, using threads.
> 
> We print from both a Windows 2000 GUI application and
> Unix server, by spawning a shell command through 
> Runtime.exec. The commands we use are along the lines
> of (I'm not at work
> 
> Win/Dos: 
> 
>   "c:/Program Files/Adobe/Acrobat 5.0/Reader/AcroRd32.exe " +
>   "/t " +
>   file + " " +
>   printerName + " " +
>   driverName + " " +
>   portName
> 
> Unix: cat blah.pdf | acroread -toPostScript | lpr
> 
> The trouble we are having is tracking the print job and knowing
> when to kill it. In the Dos version we can't get no exit status.
> In fact we currently count to 10 then kill the process.

> I think using Acrobat Reader to launch a print job is loony tunes,
> but am struggling to find a better way. Does anyone know of a better
> way, either to better control the shell command, or to fire PDF at
> a printer from Java.

I gave up using Acrobat Reader on Windows except for displaying a PDF in
a browser. I'd do all the printing via unix if that's possible.

You might also get happy using GhostScript.

Yet another possibility might be to use the AWT printing functionality
of FOP. I don't use it but others do and it seems to work well.

> Also seeing some corruptiion of the margins in the Unix case. Any
> Unix gurus know if lpr or acroread need some flags to shrink the
> margin or set the page size. So many variables...

I had that, too. You have to explicitly specify the page size using one of
those command line options.

> Prob this is all slightly off topic. Not sure. Seems printing is a 
> reasonable thing to do with a PDF so maybe we have all floundered 
> a bit in this area.
> 
> WPE
> When not Fopping, can be found floundering with style.
> 


Cheers,
Jeremias Maerki


RE: Fopping and batch printing

Posted by Philippe Pithon <pp...@sigal.fr>.
I have the same problem.
Did you find a solution ?

Otherwise, I made attempts with ghostscript 7.04 but there are the other
problems... The landscape does not work

-----Message d'origine-----
De : Wayne Elliott [mailto:wpe@iinet.net.au]
Envoyé : lundi 22 avril 2002 14:29
À : fop-user@xml.apache.org
Objet : Fopping and batch printing


Howdy

Anyone know of the best way to batch FOP generated PDF
documents for printing. In our scenario documents are
queued for generation, followed by printing, using threads.

We print from both a Windows 2000 GUI application and
Unix server, by spawning a shell command through
Runtime.exec. The commands we use are along the lines
of (I'm not at work

Win/Dos:

  "c:/Program Files/Adobe/Acrobat 5.0/Reader/AcroRd32.exe " +
  "/t " +
  file + " " +
  printerName + " " +
  driverName + " " +
  portName

Unix: cat blah.pdf | acroread -toPostScript | lpr

The trouble we are having is tracking the print job and knowing
when to kill it. In the Dos version we can't get no exit status.
In fact we currently count to 10 then kill the process.

I think using Acrobat Reader to launch a print job is loony tunes,
but am struggling to find a better way. Does anyone know of a better
way, either to better control the shell command, or to fire PDF at
a printer from Java.

Also seeing some corruptiion of the margins in the Unix case. Any
Unix gurus know if lpr or acroread need some flags to shrink the
margin or set the page size. So many variables...

Prob this is all slightly off topic. Not sure. Seems printing is a
reasonable thing to do with a PDF so maybe we have all floundered
a bit in this area.

WPE
When not Fopping, can be found floundering with style.




Fopping and batch printing

Posted by Wayne Elliott <wp...@iinet.net.au>.
Howdy

Anyone know of the best way to batch FOP generated PDF
documents for printing. In our scenario documents are
queued for generation, followed by printing, using threads.

We print from both a Windows 2000 GUI application and
Unix server, by spawning a shell command through 
Runtime.exec. The commands we use are along the lines
of (I'm not at work

Win/Dos: 

  "c:/Program Files/Adobe/Acrobat 5.0/Reader/AcroRd32.exe " +
  "/t " +
  file + " " +
  printerName + " " +
  driverName + " " +
  portName

Unix: cat blah.pdf | acroread -toPostScript | lpr

The trouble we are having is tracking the print job and knowing
when to kill it. In the Dos version we can't get no exit status.
In fact we currently count to 10 then kill the process.

I think using Acrobat Reader to launch a print job is loony tunes,
but am struggling to find a better way. Does anyone know of a better
way, either to better control the shell command, or to fire PDF at
a printer from Java.

Also seeing some corruptiion of the margins in the Unix case. Any
Unix gurus know if lpr or acroread need some flags to shrink the
margin or set the page size. So many variables...

Prob this is all slightly off topic. Not sure. Seems printing is a 
reasonable thing to do with a PDF so maybe we have all floundered 
a bit in this area.

WPE
When not Fopping, can be found floundering with style.



Re: Drawing a border around a simple word

Posted by David Wood <ob...@panix.com>.
I went through this too. I also tried borders on list cells (not pretty but 
it might have been enough of a workaround for me) - didn't work either. You 
can fake all this with tables and cell block borders if your text is static 
and you have time on your hands (you need to calculate column widths 
manually). Otherwise I think you're looking at one of the other renderers.

I found a slightly haphazard but pretty conclusive list of all of these. Of 
course, the site is down now, but google's got it cached:

http://216.239.33.100/search?q=cache:_8Rgoq_9tCgC:www.xmlsoftware.com/xslfo/+xsl+formatters+at+XMLSOFTWARE&hl=en

The cheapest commercial renderer I saw was ~$3k I believe. And XEP was $10k 
for a dual processor server ($5k per CPU)... IBM has the only plausible 
free alternative to FOP that I know of. I haven't played with it very much. 
It's here...

http://www.alphaworks.ibm.com/tech/xfc

-David

At 01:56 PM 4/4/2002 +0200, MARTIN Franck wrote:
>As a matter of fact the XSL:FO specification allows border attributes for the
>inline element which apparently is not supported by FOP.
>I thought they're might be a work around to draw a border around a word 
>placed in
>a sentence. Maybe someone successfully overcame that obstacle... If so, i 
>would
>appreciate some help very much...
>
>
>alex a écrit :
>
> > At 11:09 04/04/2002, MARTIN Franck wrote:
> > >Thank you for your suggestion but :
> > >...
> > >I really can't figure how to draw a border around a word that is 
> placed in a
> > >sentence? I think there must be a way to do so cause it must be pretty
> > >common to draw borders and the fop developpers must have taken that into
> > >account.
> >
> > Please remember that FOP is work in progress and does not have every
> > feature that the XSL:FO spec requires.
> > It is perfectly possible that this is missing.
> > If you can check that it works with other XSL:FO processors and doesn;t
> > with FOP then I am sure that the developers would be quite happy to receive
> > a bug report and test case fo file
> >
> > Alex


Re: Drawing a border around a simple word

Posted by MARTIN Franck <fr...@c-s.fr>.
As a matter of fact the XSL:FO specification allows border attributes for the
inline element which apparently is not supported by FOP.
I thought they're might be a work around to draw a border around a word placed in
a sentence. Maybe someone successfully overcame that obstacle... If so, i would
appreciate some help very much...


alex a écrit :

> At 11:09 04/04/2002, MARTIN Franck wrote:
> >Thank you for your suggestion but :
> >...
> >I really can't figure how to draw a border around a word that is placed in a
> >sentence? I think there must be a way to do so cause it must be pretty
> >common to draw borders and the fop developpers must have taken that into
> >account.
>
> Please remember that FOP is work in progress and does not have every
> feature that the XSL:FO spec requires.
> It is perfectly possible that this is missing.
> If you can check that it works with other XSL:FO processors and doesn;t
> with FOP then I am sure that the developers would be quite happy to receive
> a bug report and test case fo file
>
> Alex


Re: Drawing a border around a simple word

Posted by alex <al...@yahoo.com>.
At 11:09 04/04/2002, MARTIN Franck wrote:
>Thank you for your suggestion but :
>...
>I really can't figure how to draw a border around a word that is placed in a
>sentence? I think there must be a way to do so cause it must be pretty
>common to draw borders and the fop developpers must have taken that into
>account.


Please remember that FOP is work in progress and does not have every 
feature that the XSL:FO spec requires.
It is perfectly possible that this is missing.
If you can check that it works with other XSL:FO processors and doesn;t 
with FOP then I am sure that the developers would be quite happy to receive 
a bug report and test case fo file

Alex


Re: Drawing a border around a simple word

Posted by MARTIN Franck <fr...@c-s.fr>.
Thank you for your suggestion but :

>>bla bla bla bla <fo:block border="0.5pt solid black">
>>blaWithBorders<fo:block>bla bla bla

does not draw the text which is located outside the block element, if the
whole thing is not nested inside another block element. And if i do nest the
whole thing inside another block element, the text located inside the nested
block element takes a whole line so there are three lines total.

Your second suggestion does not display a border at all. The inline element
does not seem to implement border attributes.

I really can't figure how to draw a border around a word that is placed in a
sentence? I think there must be a way to do so cause it must be pretty
common to draw borders and the fop developpers must have taken that into
account.

please someone help me ;)

Franck


Rodolphe VAGNER a écrit :

> You should try attribute 'border'  in a fo:block :
>
> bla bla bla bla <fo:block border="0.5pt solid black">
> blaWithBorders<fo:block>bla bla bla
>
> Maybe a <fo:inline> instead of the fo:block would be better
> bla bla bla bla  <fo:inline border-left-width="thin"
> border-top-width="thin"...
> border-left-style="solid"..... >  blaWithBorders </fo:inline>bla bla bla
>
> ----- Original Message -----
> From: "MARTIN Franck" <fr...@c-s.fr>
> To: <fo...@xml.apache.org>
> Sent: Thursday, April 04, 2002 11:10 AM
> Subject: Drawing a border around a simple word
>
> > Hi all
> >
> > Does anyone know how to draw a border around a word placed in a
> > sentence?
> >
> > I would appreciate any suggestion very much ;)
> >
> > Franck
> >


Re: Drawing a border around a simple word

Posted by Rodolphe VAGNER <ro...@eurodoc-sofilog.com>.
You should try attribute 'border'  in a fo:block :

bla bla bla bla <fo:block border="0.5pt solid black">
blaWithBorders<fo:block>bla bla bla

Maybe a <fo:inline> instead of the fo:block would be better
bla bla bla bla  <fo:inline border-left-width="thin"
border-top-width="thin"...
border-left-style="solid"..... >  blaWithBorders </fo:inline>bla bla bla

----- Original Message -----
From: "MARTIN Franck" <fr...@c-s.fr>
To: <fo...@xml.apache.org>
Sent: Thursday, April 04, 2002 11:10 AM
Subject: Drawing a border around a simple word


> Hi all
>
> Does anyone know how to draw a border around a word placed in a
> sentence?
>
> I would appreciate any suggestion very much ;)
>
> Franck
>