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 Mirko Sertic <Mi...@dtmgmbh.de> on 2002/05/16 16:37:33 UTC

AW: Examples

Its not an error, its wrong java code

RENDER_PDF is s static member variable of the Driver class,
so you have to type:

    driver.setRenderer(Driver.RENDER_PDF);

Cheers

Mirko


-----Ursprungliche Nachricht-----
Von: Lee Goddard [mailto:home@LeeGoddard.com]
Gesendet: Donnerstag, 16. Mai 2002 16:39
An: fop-user@xml.apache.org
Betreff: Examples


On the examples page of the xml.apache.org/fop site,
http://xml.apache.org/fop/embedding.html
there is this sample:

    Driver driver = new Driver(new InputSource (args[0]),
                               new FileOutputStream(args[1]));
    driver.setRenderer(RENDER_PDF);
    driver.run();

I thought perhaps RENDER_PDF referred to an (imported) constant.
But I from Java1.4 am told:

C:\PXML\_printing\test.java:33: cannot resolve symbol
symbol  : variable RENDER_PDF
location: class test
                         driver.setRenderer(RENDER_PDF);

Could someone please tell me of my error?

TIA
Lee


Lee Goddard
perl -e "while(1){print rand>0.5?chr 47:chr 92}"


Re: AW: Examples

Posted by Lee Goddard <ho...@LeeGoddard.com>.
Thanks, Mirko - I didn't want to find the source,
but I guess I'll have to.  But you've got me started again,
tthanks.
lee

At 16:37 16/05/2002 +0200, Mirko Sertic wrote:
>Its not an error, its wrong java code
>
>RENDER_PDF is s static member variable of the Driver class,
>so you have to type:
>
>     driver.setRenderer(Driver.RENDER_PDF);
>
>Cheers
>
>Mirko
>
>
>-----Ursprungliche Nachricht-----
>Von: Lee Goddard [mailto:home@LeeGoddard.com]
>Gesendet: Donnerstag, 16. Mai 2002 16:39
>An: fop-user@xml.apache.org
>Betreff: Examples
>
>
>On the examples page of the xml.apache.org/fop site,
>http://xml.apache.org/fop/embedding.html
>there is this sample:
>
>     Driver driver = new Driver(new InputSource (args[0]),
>                                new FileOutputStream(args[1]));
>     driver.setRenderer(RENDER_PDF);
>     driver.run();
>
>I thought perhaps RENDER_PDF referred to an (imported) constant.
>But I from Java1.4 am told:
>
>C:\PXML\_printing\test.java:33: cannot resolve symbol
>symbol  : variable RENDER_PDF
>location: class test
>                          driver.setRenderer(RENDER_PDF);
>
>Could someone please tell me of my error?
>
>TIA
>Lee
>
>
>Lee Goddard
>perl -e "while(1){print rand>0.5?chr 47:chr 92}"


Re: unicode problem

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Henrik Holle wrote:
> i have an java string with an greek alpha letter.  i do not know how to
> convert the java unicode string so that i can display
> it with fop
> i need something like:
> 	<fo:inline  font-family="Symbol"  font-size="7pt">&#x03B1;</fo:inline>

You have at least two options:
1. Let the Java library write a stream in an encoding which
is understood by an XML parser. Look at the documentation for
java.io.OutputStreamWriter for this purpose. Create one with
UTF-8 or perhaps another UTF encoding, like
  w=new java.io.OutputStreamWriter(new FileOutputStream("f.xml"),"UTF-8")
  w.write(theString,0,theString.length());
Be sure to put an XML declaration in front with either
encoding="UTF-8" or no encoding specification at all (UTF-8
can be autodetected). There is an overwiev of character
encoding handling in Java on the package summary for java.lang.

2. Print the XML character references yourself. This isn't hard
(assuming your default character encoding is ASCII or an ASCII
extension like ISO-8859).
  for( int i=0;i<theString.length();i++ ) {
   char c=theString.charAt(i);
   int ci=(int)c;
   if( ci<=127 ) {
    System.out.print(c);
   } else {
    System.out.print("&#"+ci+";");
   }
  }

J.Pietschmann


unicode problem

Posted by Henrik Holle <hh...@megatel.de>.
hi,

i have an java string with an greek alpha letter.  i do not know how to
convert the java unicode string so that i can display
it with fop


i need something like:
	<fo:inline  font-family="Symbol"  font-size="7pt">&#x03B1;</fo:inline>