Re: Re[2]: Out of Memory Error

2001-06-22 Thread Seshadri G.K.

On the contrary, I feel patches/fixes shouldnt be posted to the entire
mailing-list. Probably all the committers should have one alias, and one
could use that. Big patches like the one I have made will waste a lot of
bandwidth being forwarded to thousands of people.


seshadri

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 21, 2001 10:00 PM
Subject: Re: Re[2]: Out of Memory Error


 Quoting Eugene Nedzvetsky [EMAIL PROTECTED]:

  No, thanks . I will receive this copy from CVS,when it will appear on
  CVS.

 I'll be back home on Sunday (the 24th). It's unlikely that I'll commit it
on
 Sunday evening, but it won't be any later than Monday.

 I'd say that under typical circumstances it's best to post material for
 potential commits right to fop-dev; that way any available committer can
pick
 up, and we avoid situations like the current one, where I'm restricted to
 webmail for 7 days.

 Regards,
 Arved


 ---
  This mail was sent through the Nova Scotia Provincial Server,
  with technical resources provided by Chebucto Community Net.
  http://nsaccess.ns.ca/mail/ http://www.chebucto.ns.ca/


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




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




[Bug 2278] New: - left indent after table

2001-06-22 Thread bugzilla

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2278

*** shadow/2278 Fri Jun 22 00:40:43 2001
--- shadow/2278.tmp.18516   Fri Jun 22 00:40:43 2001
***
*** 0 
--- 1,43 
+ ++
+ | left indent after table|
+ ++
+ |Bug #: 2278Product: Fop |
+ |   Status: NEW Version: all |
+ |   Resolution:Platform: PC  |
+ | Severity: Normal   OS/Version: Windows NT/2K   |
+ | Priority: Other Component: general |
+ ++
+ |  Assigned To: [EMAIL PROTECTED]   |
+ |  Reported By: [EMAIL PROTECTED]   |
+ |  CC list: Cc:  |
+ ++
+ |  URL:  |
+ ++
+ |  DESCRIPTION   |
+ hi there
+ 
+ i tried a few things getting started with fop and xsl:fo.
+ i ran into a suspicous behaviour when using a table.
+ after rendering the second part of my table looks like 
+ (rightmost columns omitted)
+ -
+   LN:-12345678--
+  | |brown   fox jumps  o
+  | |jumps  over  the laz
+  | |the lazy dog.  A qui
+  | |
+  | |dog.  A quick  brown
+  | |quick  brown  fox ju
+  | |
+ brown   fox jumps  o
+   |1.00 |B 910351521001 
+ 
+   | |ENTGRATRWERKZEUG   
+   | |HARTSTOFFBE-SCHICHT
+ 
+   | |Farbe  mit leerer  
+ 
+ -
+ 
+ if somebody could tell me if this is a bug in fop or a bug in 
+ my stylesheet i would greatly appreciate any comments.
\ No newline at end of file

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




Re: Code conventions

2001-06-22 Thread Keiron Liddle


On Thu, 21 Jun 2001 22:38:57 Jeremias Maerki wrote:
 Hi again
 
 When looking at the FOP source I encounter a lot of inconsistencies
 concerning tabs and spaces. Can we (or rather the committers) please
 agree on how to configure our editors to produce good-looking code? I'd
 like to propose prohibiting the use tabs, use an indentation level of 4
 spaces and enable the removal of trailing whitespace. Thanks a lot!!!
 
 Is there a document somewhere defining these things?

We actually did agree (a long time ago) to style all code with indenting of
4 spaces (no tabs) and braces on the same line as method etc.

The tool to do this (as mentioned by Steve) is jstyle (which has some bugs)
or astyle.

All committers should make an effort to format a file when committing if it
is inconsistent, of course this can make it difficult to understand diffs.


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




Re: Help in XML Rendering to PostScript

2001-06-22 Thread Hitesh Bagchi

also if I use
driver.setRenderer(Driver.RENDER_TXT);
and send the output to the printer straight away the printer is able to understand
the output and is able to print the text output. But the quality of the output
falls far short of what a pdf output can provide.

Thanks,
Hitesh


Hitesh Bagchi wrote:

 I used the following piece of code to send the pcl output to the printer(HP
 Laser Jet 6P/6MP network printer):

   FileOutputStream fos = new FileOutputStream(Melstar\\Melprn);
   Driver driver = new Driver();
   driver.setRenderer(Driver.RENDER_PCL);
   driver.addElementMapping(org.apache.fop.fo.StandardElementMapping);
   driver.addElementMapping(org.apache.fop.svg.SVGElementMapping);
   driver.addPropertyList(org.apache.fop.fo.StandardPropertyListMapping);
   driver.addPropertyList(org.apache.fop.svg.SVGPropertyListMapping);
   driver.setOutputStream(fos);
   driver.buildFOTree(parser, new InputSource(args[0]));
   driver.format();
   driver.render();

 And everything went smoothly.
 Only the printer printed a lot of junk characters like you would get if you
 write the pcl output to a file and send the file to a printer as a text file.
 Does it mean my printer do not understand pcl output.

 Thanks,
 Hitesh

 Art Welch wrote:

  I am not sure if I have the syntax exactly correct (and I do not have FOP
  installed on my Windows 2000 or NT workstations at the moment), but in the
  past I have successfully printed directly to a network printer, just by
  opening a file stream to it. For example in your example only the first line
  would need to change something like:
 
  FileOutputStream fos = new
  FileOutputStream(hostname\\printername);
 
  For a local printer you should be able to do something like:
 
  FileOutputStream fos = new FileOutputStream(lpt1);
 
  HTH,
  Art
 
  -Original Message-
  From: Hitesh Bagchi [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, June 21, 2001 12:35 AM
  To: [EMAIL PROTECTED]
  Subject: Re: Help in XML Rendering to PostScript
 
  I am using windows NT and I am trying to print the PCL output directly to
  the
  printer which is a
  HP Laser Jet 6P/6MP network printer from my application. Here is my piece of
  code :
  --
  ---
 
  FileOutputStream fos = new FileOutputStream(../temp/tTest.pcl);
  Driver driver = new Driver();
  driver.setRenderer(Driver.RENDER_PCL);
  driver.addElementMapping(org.apache.fop.fo.StandardElementMapping);
  driver.addElementMapping(org.apache.fop.svg.SVGElementMapping);
  driver.addPropertyList(org.apache.fop.fo.StandardPropertyListMapping);
  driver.addPropertyList(org.apache.fop.svg.SVGPropertyListMapping);
  driver.setOutputStream(fos);
  driver.buildFOTree(parser, new InputSource(args[0]));
  driver.format();
  driver.render();
  
  ---
 
  Now instead of printing to the Test.pcl file I want to send the output
  directly
  to the HP Laser Jet 6P/6MP
  printer on the network.
 
  Thanks,
  Hitesh
 
  Art Welch wrote:
 
   I thought that I had answered a question about direct printing PCL
  recently.
   If you will tell me what platform you are using (Windows/Unix) and how you
   are invoking FOP (application or command line). I will try to answer this.
  
   Art
  
   -Original Message-
   From: Hitesh Bagchi [mailto:[EMAIL PROTECTED]]
   Sent: Saturday, June 16, 2001 1:50 AM
   To: [EMAIL PROTECTED]
   Subject: Re: Help in XML Rendering to PostScript
  
   Hello,
   Can somebody tell me how to stream PCL output to a network printer without
   writing to a file.
  
   Thanks,
   Hitesh
  
   [EMAIL PROTECTED] wrote:
  
Hello,
   
I am fairly new to FOP and to Java as well.  I am wondering if anyone
  has
written a rendering to convert an XML stream to Postscript with FOP
   (similar
to the PCL or PDF renderer) - I am in desperate need of a mechanism to
  do
this.  We have a current Java app that converts an XML stream into PDF,
   but
printing through Adobe Acrobat is too resource intensive on the lower
  end
machines.  I have tried converting to PCL and then streaming to a port,
which works pretty well, but is not a 100% compatibile (PCL beng only
  HP)
   
If anyone knows of a way to convert an XML to PS format using a custom
  FOP
piece they've written, or knows of a better mechanism, I'd be forever
grateful!
   
Thanks very much,
   
Tony
   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, email: [EMAIL PROTECTED]
  
   

cvs commit: xml-fop/src/org/apache/fop/render/ps - New directory

2001-06-22 Thread keiron

keiron  01/06/22 01:30:37

  xml-fop/src/org/apache/fop/render/ps - New directory

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




cvs commit: xml-fop/src/org/apache/fop/fo/pagination PageSequence.java Root.java

2001-06-22 Thread keiron

keiron  01/06/22 01:52:08

  Modified:src/org/apache/fop/fo/pagination PageSequence.java Root.java
  Log:
  should handle page number properly, with threads
  and multiple page sequences
  also cleaned up code
  Submitted by: Jeremias Maerki [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.29  +353 -386  xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java
  
  Index: PageSequence.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- PageSequence.java 2001/05/01 01:00:32 1.28
  +++ PageSequence.java 2001/06/22 08:52:08 1.29
  @@ -1,8 +1,7 @@
  -/*-- $Id: PageSequence.java,v 1.28 2001/05/01 01:00:32 arved Exp $ -- 
  - *
  +/*-- $Id: PageSequence.java,v 1.29 2001/06/22 08:52:08 keiron Exp $ --
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the 
  - * LICENSE file included with these sources.
  + * For details on use and redistribution please refer to the
  + * LICENSE file included with these sources.
*/
   
   package org.apache.fop.fo.pagination;
  @@ -19,7 +18,7 @@
   import org.apache.fop.layout.AreaTree;
   import org.apache.fop.layout.Page;
   import org.apache.fop.layout.PageMaster;
  -import org.apache.fop.apps.FOPException;   
  +import org.apache.fop.apps.FOPException;
   
   // Java
   import java.util.*;
  @@ -29,15 +28,13 @@
* This provides pagination of flows onto pages. Much of the logic for paginating
* flows is contained in this class. The main entry point is the format method.
*/
  -public class PageSequence extends FObj
  -{
  +public class PageSequence extends FObj {
   //
   // Factory methods
   //
  -public static class Maker extends FObj.Maker
  -{
  -public FObj make(FObj parent, PropertyList propertyList)
  -throws FOPException {
  +public static class Maker extends FObj.Maker {
  +public FObj make(FObj parent,
  + PropertyList propertyList) throws FOPException {
   return new PageSequence(parent, propertyList);
   }
   }
  @@ -74,11 +71,11 @@
   /** the master-name attribute */
   private String masterName;
   
  - // according to communication from Paul Grosso (XSL-List,
  - // 001228, Number 406), confusion in spec section 6.4.5 about
  - // multiplicity of fo:flow in XSL 1.0 is cleared up - one (1)
  - // fo:flow per fo:page-sequence only.
  - private boolean isFlowSet = false;
  +// according to communication from Paul Grosso (XSL-List,
  +// 001228, Number 406), confusion in spec section 6.4.5 about
  +// multiplicity of fo:flow in XSL 1.0 is cleared up - one (1)
  +// fo:flow per fo:page-sequence only.
  +private boolean isFlowSet = false;
   
   //
   // state attributes used during layout
  @@ -88,9 +85,6 @@
   
   private int currentPageNumber = 0;
   
  -/** keeps count of page number from previous PageSequence */
  -private int runningPageNumberCounter = 0;
  -
   /** specifies page numbering type (auto|auto-even|auto-odd|explicit) */
   private int pageNumberType;
   
  @@ -107,78 +101,65 @@
   private String currentPageMasterName;
   
   
  -protected PageSequence(FObj parent, PropertyList propertyList)
  -throws FOPException {
  +protected PageSequence(FObj parent,
  +   PropertyList propertyList) throws FOPException {
   super(parent, propertyList);
   this.name = fo:page-sequence;
   
  -if ( parent.getName().equals(fo:root) )
  -{
  -this.runningPageNumberCounter=0; //else not initialized correctly
  +if (parent.getName().equals(fo:root)) {
   this.root = (Root) parent;
   this.root.addPageSequence(this);
  -}
  -else
  -{
  -throw
  -new FOPException(page-sequence must be child of root, not 
  -+ parent.getName());
  +} else {
  +throw new FOPException(
  +  page-sequence must be child of root, not  +
  +  parent.getName());
   }
  - 
  +
   layoutMasterSet = root.getLayoutMasterSet();
   
  - // best time to run some checks on LayoutMasterSet
  +// best time to run some checks on LayoutMasterSet
   layoutMasterSet.checkRegionNames();
  -
  - _flowMap = new Hashtable();
   
  -thisIsFirstPage=true; // we are now on the first page of the page sequence
  -String ipnValue= this.properties.get(initial-page-number).getString();
  +_flowMap = new Hashtable();
   
  -if ( ipnValue.equals(auto) )
  -{
  -pageNumberType=AUTO;
  -}
  -

cvs commit: xml-fop/src/org/apache/fop/render/ps ASCII85EncodeFilter.java ASCIIHexEncodeFilter.java Filter.java FilterThread.java FlateEncodeFilter.java PSRenderer.java PSStream.java

2001-06-22 Thread keiron

keiron  01/06/22 02:08:51

  Added:   src/org/apache/fop/render/ps ASCII85EncodeFilter.java
ASCIIHexEncodeFilter.java Filter.java
FilterThread.java FlateEncodeFilter.java
PSRenderer.java PSStream.java
  Log:
  New addition: postscript renderer
  Submitted by: Jeremias Maerki [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.1  xml-fop/src/org/apache/fop/render/ps/ASCII85EncodeFilter.java
  
  Index: ASCII85EncodeFilter.java
  ===
  /* $Id: ASCII85EncodeFilter.java,v 1.1 2001/06/22 09:08:50 keiron Exp $
   * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
   * For details on use and redistribution please refer to the
   * LICENSE file included with these sources.
   */
  
  package org.apache.fop.render.ps;
  
  import java.io.*;
  
  public class ASCII85EncodeFilter implements Filter {
  
  private static final char ASCII85_ZERO = 'z';
  private static final char ASCII85_START = '!';
  private static final char ASCII85_EOL = '\n';
  private static final String ASCII85_EOD = ~;
  private static final String ENCODING = US-ASCII;
  
  private static final long base85_4 = 85;
  private static final long base85_3 = base85_4 * base85_4;
  private static final long base85_2 = base85_3 * base85_4;
  private static final long base85_1 = base85_2 * base85_4;
  
  protected ASCII85EncodeFilter() {
  }
  
  public long write(OutputStream out, byte[] buf, int len,
long bw) throws IOException {
  //Assumption: len80
  int line = (int)(bw % 80) + len;
  if (line = 80) {
  int first = len - (line - 80);
  out.write(buf, 0, first);
  out.write(ASCII85_EOL);
  out.write(buf, first, len - first);
  } else {
  out.write(buf, 0, len);
  }
  return bw + len;
  }
  
  public void doFilter(InputStream in,
   OutputStream out) throws IOException {
  int total = 0;
  int diff = 0;
  long bw = 0;
  
  // first encode the majority of the data
  // each 4 byte group becomes a 5 byte group
  byte[] data = new byte[4];
  int bytes_read;
  while ((bytes_read = in.read(data)) == data.length) {
  long val = ((data[0]  24)  0xff00L)// note: must have the L at the
 + ((data[1]  16)  0xffL)// end, otherwise you get into
 + ((data[2]  8)  0xff00L)// weird signed value problems
 + (data[3]  0xffL); // cause we're using a full 32 bits
  byte[] conv = convertWord(val);
  
  bw = write(out, conv, conv.length, bw);
  }
  
  // now take care of the trailing few bytes.
  // with n leftover bytes, we append 0 bytes to make a full group of 4
  // then convert like normal (except not applying the special zero rule)
  // and write out the first n+1 bytes from the result
  if ((bytes_read  data.length)  (bytes_read = 0)) {
  int n = data.length - bytes_read;
  byte[] lastdata = new byte[4];
  int i = 0;
  for (int j = 0; j  4; j++) {
  if (j  n) {
  lastdata[j] = data[i++];
  } else {
  lastdata[j] = 0;
  }
  }
  
  long val = ((lastdata[0]  24)  0xff00L) +
 ((lastdata[1]  16)  0xffL) +
 ((lastdata[2]  8)  0xff00L) + (lastdata[3]  0xffL);
  
  byte[] conv;
  // special rule for handling zeros at the end
  if (val != 0) {
  conv = convertWord(val);
  } else {
  conv = new byte[5];
  for (int j = 0; j  5; j++) {
  conv[j] = (byte)'!';
  }
  }
  // assert n+1 = 5
  bw = write(out, conv, n + 1, bw);
  // System.out.println(ASCII85 end of data was +n+ bytes long);
  
  }
  // finally write the two character end of data marker
  byte[] EOD = ASCII85_EOD.getBytes();
  bw = write(out, EOD, EOD.length, bw);
  }
  
  /**
   * This converts a 32 bit value (4 bytes) into 5 bytes using base 85.
   * each byte in the result starts with zero at the '!' character so
   * the resulting base85 number fits into printable ascii chars
   *
   * @param word the 32 bit unsigned (hence the long datatype) word
   * @return 5 bytes (or a single byte of the 'z' character for word
   * values of 0)
   */
  private byte[] convertWord(long word) {
  word = word  0x;
  if (word  0) 

[Bug 2279] New: - block-container property position does not exist

2001-06-22 Thread bugzilla

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2279

*** shadow/2279 Fri Jun 22 02:26:22 2001
--- shadow/2279.tmp.18640   Fri Jun 22 02:26:22 2001
***
*** 0 
--- 1,19 
+ ++
+ | block-container property position does not exist |
+ ++
+ |Bug #: 2279Product: Fop |
+ |   Status: NEW Version: all |
+ |   Resolution:Platform: All |
+ | Severity: Normal   OS/Version: All |
+ | Priority: Other Component: general |
+ ++
+ |  Assigned To: [EMAIL PROTECTED]   |
+ |  Reported By: [EMAIL PROTECTED]   |
+ |  CC list: Cc:  |
+ ++
+ |  URL:  |
+ ++
+ |  DESCRIPTION   |
+ The block-container property position does not exist. It must be renamed to
+ absolute-position
+ BTW, why does the documentation say that the block-container is unsupported?
\ No newline at end of file

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




Help please with Fonts and FOP : FW: Adding additional fonts to FOP 0.17.0

2001-06-22 Thread Ricardo Coutinho

Hi

I posted this message a couple of days back regarding adding additional
fonts to FOP. Unfortunately I did not get much response to my problem. Can
someone please give me a few pointers on how to get wround my problem.

Thanks in advance

Ricardo Coutinho

-Original Message-
From: Ricardo Coutinho [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 20, 2001 17:19 PM
To: [EMAIL PROTECTED]
Subject: Adding additional fonts to FOP 0.17.0


Hi all

I am trying to use additional fonts as part in my PDF creation process.
However I am getting a number of errors/funnies which is making my life
difficult.

1. I get the error below when trying to generate the font metrics file for
the Arial font.
TTF Reader v1.0

Reading D:\winnt\fonts\arial.ttf...

Read dir tab [68 83 73 71] offset: 146136 length: 5096 name: DSIG
Read dir tab [76 84 83 72] offset: 6752 length: 659 name: LTSH
Read dir tab [79 83 47 50] offset: 456 length: 86 name: OS/2
Read dir tab [80 67 76 84] offset: 146080 length: 54 name: PCLT
Read dir tab [86 68 77 88] offset: 7412 length: 4500 name: VDMX
Read dir tab [99 109 97 112] offset: 3704 length: 1734 name: cmap
Read dir tab [99 118 116 32] offset: 15432 length: 1416 name: cvt
Read dir tab [102 112 103 109] offset: 13976 length: 1456 name: fpgm
Read dir tab [103 97 115 112] offset: 544 length: 16 name: gasp
Read dir tab [103 108 121 102] offset: 35316 length: 100434 name: glyf
Read dir tab [104 100 109 120] offset: 19468 length: 15848 name: hdmx
Read dir tab [104 101 97 100] offset: 332 length: 54 name: head
Read dir tab [104 104 101 97] offset: 388 length: 36 name: hhea
Read dir tab [104 109 116 120] offset: 16848 length: 2620 name: hmtx
Read dir tab [107 101 114 110] offset: 140608 length: 5472 name: kern
Read dir tab [108 111 99 97] offset: 5440 length: 1312 name: loca
Read dir tab [109 97 120 112] offset: 424 length: 32 name: maxp
Read dir tab [110 97 109 101] offset: 560 length: 3143 name: name
Read dir tab [112 111 115 116] offset: 135752 length: 4856 name: post
Read dir tab [112 114 101 112] offset: 11912 length: 2063 name: prep
java.io.EOFException: Reached EOF, file size=151232
at
org.apache.fop.fonts.FontFileReader.readTTFString(FontFileReader.java:220)
at org.apache.fop.fonts.TTFFile.readFont(TTFFile.java:221)
at org.apache.fop.fonts.apps.TTFReader.loadTTF(TTFReader.java:207)
at org.apache.fop.fonts.apps.TTFReader.main(TTFReader.java:176)

   
 
-



2 I managed to generate the metrics file using the latest Fop-0.19.0-CVS
version (I downloaded today) and tha worked. However the generate process
seemed to skip out certain nodes that the version 1.0 TTF reader creates ie
class-name, first-char, last-char. Without those entries I was not
able to rebuild FOP
TTF Reader v1.1.1

Reading D:\winnt\fonts\arial.ttf...

Number of glyphs in font: 655
Creating xml font file...

Creating CID encoded metrics
Writing xml font file Arial.xml...

This font contains no embedding license restrictions
   
 
-


3 I did finaly manage to rebuild FOP with the Arial font built in. However,
the resulting PDF was all messed up. I have attached snippets of the 2
outputs. Did this happen because the font-metrics file is missing
entries...?



Thanks in advance for you help.


Ricardo Coutinho
Developer


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


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




RE: Help in XML Rendering to PostScript

2001-06-22 Thread avespa

In terms of the solution for streaming to an LPT port or network printer, is
there a way to catch an error if this fails?  Lets say I have a network
printer and it is offline, how can I know if it worked or not?  It's a blind
process.

Thanks!



-Original Message-
From: Hitesh Bagchi [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 22, 2001 3:56 AM
To: [EMAIL PROTECTED]
Subject: Re: Help in XML Rendering to PostScript


also if I use
driver.setRenderer(Driver.RENDER_TXT);
and send the output to the printer straight away the printer is able to
understand
the output and is able to print the text output. But the quality of the
output
falls far short of what a pdf output can provide.

Thanks,
Hitesh


Hitesh Bagchi wrote:

 I used the following piece of code to send the pcl output to the
printer(HP
 Laser Jet 6P/6MP network printer):

   FileOutputStream fos = new FileOutputStream(Melstar\\Melprn);
   Driver driver = new Driver();
   driver.setRenderer(Driver.RENDER_PCL);
   driver.addElementMapping(org.apache.fop.fo.StandardElementMapping);
   driver.addElementMapping(org.apache.fop.svg.SVGElementMapping);
   driver.addPropertyList(org.apache.fop.fo.StandardPropertyListMapping);
   driver.addPropertyList(org.apache.fop.svg.SVGPropertyListMapping);
   driver.setOutputStream(fos);
   driver.buildFOTree(parser, new InputSource(args[0]));
   driver.format();
   driver.render();

 And everything went smoothly.
 Only the printer printed a lot of junk characters like you would get if
you
 write the pcl output to a file and send the file to a printer as a text
file.
 Does it mean my printer do not understand pcl output.

 Thanks,
 Hitesh

 Art Welch wrote:

  I am not sure if I have the syntax exactly correct (and I do not have
FOP
  installed on my Windows 2000 or NT workstations at the moment), but in
the
  past I have successfully printed directly to a network printer, just by
  opening a file stream to it. For example in your example only the first
line
  would need to change something like:
 
  FileOutputStream fos = new
  FileOutputStream(hostname\\printername);
 
  For a local printer you should be able to do something like:
 
  FileOutputStream fos = new FileOutputStream(lpt1);
 
  HTH,
  Art
 
  -Original Message-
  From: Hitesh Bagchi [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, June 21, 2001 12:35 AM
  To: [EMAIL PROTECTED]
  Subject: Re: Help in XML Rendering to PostScript
 
  I am using windows NT and I am trying to print the PCL output directly
to
  the
  printer which is a
  HP Laser Jet 6P/6MP network printer from my application. Here is my
piece of
  code :
 
--
  ---
 
  FileOutputStream fos = new FileOutputStream(../temp/tTest.pcl);
  Driver driver = new Driver();
  driver.setRenderer(Driver.RENDER_PCL);
 
driver.addElementMapping(org.apache.fop.fo.StandardElementMapping);
  driver.addElementMapping(org.apache.fop.svg.SVGElementMapping);
 
driver.addPropertyList(org.apache.fop.fo.StandardPropertyListMapping);
  driver.addPropertyList(org.apache.fop.svg.SVGPropertyListMapping);
  driver.setOutputStream(fos);
  driver.buildFOTree(parser, new InputSource(args[0]));
  driver.format();
  driver.render();
 

  ---
 
  Now instead of printing to the Test.pcl file I want to send the output
  directly
  to the HP Laser Jet 6P/6MP
  printer on the network.
 
  Thanks,
  Hitesh
 
  Art Welch wrote:
 
   I thought that I had answered a question about direct printing PCL
  recently.
   If you will tell me what platform you are using (Windows/Unix) and how
you
   are invoking FOP (application or command line). I will try to answer
this.
  
   Art
  
   -Original Message-
   From: Hitesh Bagchi [mailto:[EMAIL PROTECTED]]
   Sent: Saturday, June 16, 2001 1:50 AM
   To: [EMAIL PROTECTED]
   Subject: Re: Help in XML Rendering to PostScript
  
   Hello,
   Can somebody tell me how to stream PCL output to a network printer
without
   writing to a file.
  
   Thanks,
   Hitesh
  
   [EMAIL PROTECTED] wrote:
  
Hello,
   
I am fairly new to FOP and to Java as well.  I am wondering if
anyone
  has
written a rendering to convert an XML stream to Postscript with FOP
   (similar
to the PCL or PDF renderer) - I am in desperate need of a mechanism
to
  do
this.  We have a current Java app that converts an XML stream into
PDF,
   but
printing through Adobe Acrobat is too resource intensive on the
lower
  end
machines.  I have tried converting to PCL and then streaming to a
port,
which works pretty well, but is not a 100% compatibile (PCL beng
only
  HP)
   
If anyone knows of a way to convert an XML to PS format using a
custom
  FOP
piece they've written, or knows of a better mechanism, I'd be
forever
grateful!
   

cvs commit: xml-fop/src/org/apache/fop/render/ps PSGraphics2D.java PSRenderer.java

2001-06-22 Thread keiron

keiron  01/06/22 07:16:48

  Modified:src/org/apache/fop/render/ps PSRenderer.java
  Added:   src/org/apache/fop/render/ps PSGraphics2D.java
  Log:
  added support for rendering SVG graphics to ps
  not fully functional
  
  Revision  ChangesPath
  1.2   +210 -5xml-fop/src/org/apache/fop/render/ps/PSRenderer.java
  
  Index: PSRenderer.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/ps/PSRenderer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PSRenderer.java   2001/06/22 09:08:50 1.1
  +++ PSRenderer.java   2001/06/22 14:16:46 1.2
  @@ -1,4 +1,4 @@
  -/* $Id: PSRenderer.java,v 1.1 2001/06/22 09:08:50 keiron Exp $
  +/* $Id: PSRenderer.java,v 1.2 2001/06/22 14:16:46 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
  @@ -18,14 +18,36 @@
   import org.apache.fop.datatypes.*;
   import org.apache.fop.fo.properties.*;
   import org.apache.fop.render.pdf.Font;
  +import org.apache.fop.image.*;
   
  +import org.apache.batik.bridge.*;
  +import org.apache.batik.swing.svg.*;
  +import org.apache.batik.swing.gvt.*;
  +import org.apache.batik.gvt.*;
  +import org.apache.batik.gvt.renderer.*;
  +import org.apache.batik.gvt.filter.*;
  +import org.apache.batik.gvt.event.*;
  +
   // SVG
   import org.w3c.dom.svg.SVGSVGElement;
   import org.w3c.dom.svg.SVGDocument;
  +import org.w3c.dom.*;
  +import org.w3c.dom.svg.*;
   
   // Java
   import java.io.*;
   import java.util.*;
  +import java.io.IOException;
  +import java.io.OutputStream;
  +import java.util.Enumeration;
  +import java.util.Vector;
  +import java.util.Hashtable;
  +import java.awt.geom.AffineTransform;
  +import java.awt.geom.Dimension2D;
  +import java.awt.Point;
  +import java.awt.RenderingHints;
  +import java.awt.font.FontRenderContext;
  +import java.awt.Dimension;
   
   /**
* Renderer that renders to PostScript.
  @@ -401,17 +423,94 @@
   public void renderSVGArea(SVGArea area) {
   int x = this.currentXPosition;
   int y = this.currentYPosition;
  -SVGSVGElement svg =
  -  ((SVGDocument) area.getSVGDocument()).getRootElement();
  +Document doc = area.getSVGDocument();
  +SVGSVGElement svg = ((SVGDocument)doc).getRootElement();
   int w = (int)(svg.getWidth().getBaseVal().getValue() * 1000);
   int h = (int)(svg.getHeight().getBaseVal().getValue() * 1000);
  +float sx = 1, sy = -1;
  +int xOffset = x, yOffset = y;
   
  +/*
  + * Clip to the svg area.
  + * Note: To have the svg overlay (under) a text area then use
  + * an fo:block-container
  + */
   comment(% --- SVG Area);
  -/**@todo Implement SVG */
  +write(gsave);
  +if (w != 0  h != 0) {
  +/*write(newpath);
  +write(x / 1000f +   + y / 1000f +  M);
  +write((x + w) / 1000f +   + y / 1000f +  rlineto);
  +write((x + w) / 1000f +   + (y - h) / 1000f +
  +   rlineto);
  +write(x / 1000f +   + (y - h) / 1000f +  rlineto);
  +write(closepath);
  +write(clippath);
  +*/}
  +// transform so that the coordinates (0,0) is from the top left
  +// and positive is down and to the right. (0,0) is where the
  +// viewBox puts it.
  +write(xOffset +
  ++ yOffset +  translate);
  +write(sx +   + sy +   +  scale);
  +
  +
  +UserAgent userAgent = new MUserAgent(new AffineTransform());
  +
  +GVTBuilder builder = new GVTBuilder();
  +GraphicsNodeRenderContext rc = getRenderContext();
  +BridgeContext ctx = new BridgeContext(userAgent, rc);
  +GraphicsNode root;
  +PSGraphics2D graphics =
  +  new PSGraphics2D(false, area.getFontState(), this,
  +currentFontName, currentFontSize, currentXPosition,
  +currentYPosition);
  +graphics.setGraphicContext(
  +  new org.apache.batik.ext.awt.g2d.GraphicContext());
  +graphics.setRenderingHints(rc.getRenderingHints());
  +try {
  +root = builder.build(ctx, doc);
  +root.paint(graphics, rc);
  +} catch (Exception e) {
  +MessageHandler.errorln(Error: svg graphic could not be rendered:  + 
e.getMessage());
  +//e.printStackTrace();
  +}
  +
  +write(grestore);
  +
   comment(% --- SVG Area end);
   movetoCurrPosition();
   }
   
  +public GraphicsNodeRenderContext getRenderContext() {
  +GraphicsNodeRenderContext nodeRenderContext = null;
  +if (nodeRenderContext == 

RE: Text-Transform

2001-06-22 Thread John Wyman

Yes, It does work under .12, I hacked the code to put it in as
font-variant for now. I'll try the XSLT translate.
Thanks
John


John H. Wyman
5160 Darry Lane
Dublin, OH 43016
(614)-889-0698
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
Wyman Genealogy Site http://www.wyman.org
Francis Wyman Assoc email List
http://groups.yahoo.com/group/FrancisWymanAssoc
Wyman Family Genealogy Forum http://genforum.genealogy.com/wyman/
The Wyman Surname Message Board
http://www.familyhistory.com/messages/messages.asp?category=surnamefor
um=Wyman

  

-Original Message-
From: Christian Geisert [mailto:[EMAIL PROTECTED]] 
Sent: Friday, June 22, 2001 12:53 PM
To: [EMAIL PROTECTED]
Subject: Re: Text-Transform


 John Wyman wrote:
 
 I need to produce all capital output from possibly mixed input text, 
 and the text-transform=uppercase seems to generate a not supported 
 warning, this used to work in .12, am I doing something wrong ?

Are you really sure that it worked with FOP 0.12 ?
It is not supported in current FOP.

I actually have running code for text-transform, it just needs a bit
cleanup and testing (read: I need some time...)

Or you can use XSLT for this:  translate(text,'abcd','ABCD')

 John H. Wyman


Christian

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


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




RE: Modification in line placement

2001-06-22 Thread John Wyman

Karen,
Could you email me the fix, I'm really in a bind, and need to work on my
style sheets and can't as long as this item is outstanding.
Thanks
John


John H. Wyman
5160 Darry Lane
Dublin, OH 43016
(614)-889-0698
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
Wyman Genealogy Site http://www.wyman.org
Francis Wyman Assoc email List
http://groups.yahoo.com/group/FrancisWymanAssoc
Wyman Family Genealogy Forum http://genforum.genealogy.com/wyman/
The Wyman Surname Message Board
http://www.familyhistory.com/messages/messages.asp?category=surnamefor
um=Wyman

  

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf
Of Karen Lease
Sent: Wednesday, June 20, 2001 5:59 PM
To: [EMAIL PROTECTED]
Subject: Modification in line placement


Hi,

While debugging a strange problem from John Wyman recently, I discovered
an inconsistency in how we decide whether a block area has room for
another line of text. It works differently on the first line in the
block from the remaining lines.

This isn't necessarily stupid, at least for some line-stacking-strategy
values. However, for the fairly simple one FOP is currently
implementing, it can lead to some strange results.

I also noticed that the way we are calculating half-leading in BlockArea
isn't correct according to the CR. The result is that our actual
line-spacing tends to be less than what the stylesheet uses as a
line-height value. This is because the glyph height of a font
(ascender + descender) is typically less than the actual font-size
value.

The fix is trivial, but it will change all existing test results,
because the line-spacing will increase! Because of that, I haven't yet
committed it. Opinions?

Regards,
Karen


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


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




Page break problem in FOP 0.19.0

2001-06-22 Thread Qi Chen
Title: Page break problem in FOP 0.19.0






I have nested tables in my FO files and used to have premature page breaks with FOP 0.18.1. After downloading the source code through CVS and building fop.jar, the pages are properly generated. I downloaded the source through CVS on 6/5/2001.

But after downloading the FOP 0.19.0, the page doesn't break at all and it goes all the way to the foot notes, throwing away the left-over. Could anyone help me, please? thanks

-Qi





RE: PostScript Renderer

2001-06-22 Thread Arved_37

Yeah, I was pretty impressed myself. Concept to realization, for complete
SVG-PS renderer, in 45 minutes. :-) Now THAT is extreme programming!

Regards,
Arved Sandstrom

Quoting Art Welch [EMAIL PROTECTED]:

 Wow, that was fast. I was thinking that if I ever get to JDK 1.2+ I would
 try to get the PCLRenderer working with Batik. I had been thinking that
 this
 would be a bit of a project. I guess it should not be that bad...
 especially
 since I can cheat and look at what you did for PS.
 
 Art
 
 -Original Message-
 From: Keiron Liddle [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 22, 2001 10:48 AM
 To: [EMAIL PROTECTED]
 Subject: Re: PostScript Renderer
 
 
 
 On Fri, 22 Jun 2001 10:03:22 Keiron Liddle wrote:
  
  I might also have a look at the svg rendering.
  
 
 I have added an svg renderer for the postscript.
 
 This is unfinished since as I haven't bothered to work out a replacement
 for the quad-to command (which means text won't work) and I haven't checked
 images.
 The other stuff should work ok.
 
 So if anyone knows a replacement for quad-to 
 
 If the ps code was separated out then it would be a short step to creating
 an svg - ps transcoder for batik.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 


---
 This mail was sent through the Nova Scotia Provincial Server, 
 with technical resources provided by Chebucto Community Net.
 http://nsaccess.ns.ca/mail/ http://www.chebucto.ns.ca/


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




[Bug 2296] New: - Calling Fop through a servlet

2001-06-22 Thread bugzilla

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2296

*** shadow/2296 Fri Jun 22 17:31:48 2001
--- shadow/2296.tmp.24499   Fri Jun 22 17:31:48 2001
***
*** 0 
--- 1,63 
+ ++
+ | Calling Fop through a servlet  |
+ ++
+ |Bug #: 2296Product: Fop |
+ |   Status: NEW Version: all |
+ |   Resolution:Platform: PC  |
+ | Severity: Critical OS/Version: Windows NT/2K   |
+ | Priority: Other Component: pdf renderer|
+ ++
+ |  Assigned To: [EMAIL PROTECTED]   |
+ |  Reported By: [EMAIL PROTECTED]|
+ |  CC list: Cc:  |
+ ++
+ |  URL:  |
+ ++
+ |  DESCRIPTION   |
+ Hi I am using latest Fop 19. I am able to convert my .fo files to .pdf easily 
+ by using fop.bat file. I am trying to create a servlet which can provide the 
+ functionality of converting any file (chosen by user through browser., 
+ mainly .fo) to pdf. I found an example FopServlet that accomplishes the 
+ purpose. But I am not able to compile the FopServlet.java to .class file. It 
+ did not compile and the following are the error I got.
+ 
+ 
+ D:\manik\fop19\docs\examples\embeddingjavac FopServlet.java
+ FopServlet.java:59: Class org.xml.sax.InputSource not found in import.
+ import org.xml.sax.InputSource;
+^
+ FopServlet.java:60: Class org.xml.sax.XMLReader not found in import.
+ import org.xml.sax.XMLReader;
+^
+ FopServlet.java:62: Class org.apache.fop.apps.Driver not found in import.
+ import org.apache.fop.apps.Driver;
+^
+ FopServlet.java:63: Class org.apache.fop.apps.Version not found in import.
+ import org.apache.fop.apps.Version;
+^
+ 4 errorsD:\manik\fop19\docs\examples\embeddingjavac FopServlet.java
+ FopServlet.java:59: Class org.xml.sax.InputSource not found in import.
+ import org.xml.sax.InputSource;
+^
+ FopServlet.java:60: Class org.xml.sax.XMLReader not found in import.
+ import org.xml.sax.XMLReader;
+^
+ FopServlet.java:62: Class org.apache.fop.apps.Driver not found in import.
+ import org.apache.fop.apps.Driver;
+^
+ FopServlet.java:63: Class org.apache.fop.apps.Version not found in import.
+ import org.apache.fop.apps.Version;
+^
+ 4 errors
+ 
+ 
+ I tried to build the fop by the calling build.bat(d:\manik\fop19\build.bat) in 
+ the command line. The build was successfull., but still javac FopServlet.java 
+ was not sucessfull. Please let me know, how i can call successfully create the 
+ class FopServlet.class and call it through a servlet (running from jakarta 
+ tomcat server).
+ 
+ Please help us ASAP.
+ 
+ Thanks
+ Manik
\ No newline at end of file

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