RE: Convert InputSource into a Character array

2007-04-06 Thread Sascha Schmidt
Hi Harshini,

I though you were using a large XML String (/Character-Array) with a
CharArrayReader to setup your InputSource. Maybe I was wrong? How do you
create your input source? It seems that someone uses and closes the
InputSource (i.e. the stream) before FOP is invoked? Things are still a bit
unclear for me. ;-) Could you please tell me, what you are doing before FOP
is invoked and what is done afterwards?

Cheers,
Sascha

 


 -Original Message-
 From: Harshini Madurapperuma [mailto:[EMAIL PROTECTED]
 Sent: Thursday, April 05, 2007 12:55 PM
 To: fop-users@xmlgraphics.apache.org
 Subject: RE: Convert InputSource into a Character array
 
 Hi all, and Sascha
 
 Sascha thanx a lot for ur ideas; but I'm not clear what u have meant by
 String xml in the
 MyInputSource constructor. And from where should I call this constructor?
 
 Harshini
 
 -Original Message-
 From: Sascha Schmidt [mailto:[EMAIL PROTECTED]
 Sent: Thursday, April 05, 2007 9:55 AM
 To: fop-users@xmlgraphics.apache.org
 Subject: RE: Convert InputSource into a Character array
 
 Hi all,
 
 I assume Harshini needs to get the original XML-String from a
 CharArrayReader (after rendering), which he used to equip the InputSource.
 IMHO there is no chance to get the XML-String back, because
 CharArrayReader.close() sets the internal Char-Buffer, which holds the
 XML-String, to null. Thus one would either need to introduce a new
 attribute
 somewhere in Harshinis class/code or extending class InputSource. I would
 prefer the second method. This should give you a start point:
 
 class MyInputSource extends InputSource{
 
   private String xml;
 
   public MyInputSource(String xml){
 super(new CharArrayReader(xml));
   }
 
   public String getXML(){
 return this.xml;
   }
 }
 
 
 Somewhere later...
 
 ((MyInputSource) source).getXML()
 
 returns the xml.
 
 Note that the code above is not tested, just typed in Outlook. ;-)
 
 Cheers,
 Sascha
 
 PS: Of course it is correct that FOP closes the stream after processing
 it.
 
 
   NORTHBIT
 RTF to XSL-FO, Reporting
 Dipl. Inf. Sascha Schmidt
 [EMAIL PROTECTED]
   www.northbit.de
 
 
  -Original Message-
  From: Harshini Madurapperuma [mailto:[EMAIL PROTECTED]
  Sent: Thursday, April 05, 2007 5:18 AM
  To: fop-users@xmlgraphics.apache.org
  Subject: RE: Convert InputSource into a Character array
 
  Hi;
 
  I have this character array, I converted that character array into to
  a InputSource and passed it as a parameter to a  render(XMLReader
  parser, InputSource source) method in the DRIVER class in fop.
 
  Within that render class I need to convert that InputSource (source)
  back into a character array (after doing some modifications inside
  that method). I tried to convert that as follows:
 
   if (source.getCharacterStream() != null) {
 BufferedReader reader = new
  BufferedReader(source.getCharacterStream());
 CharArrayWriter writer=new CharArrayWriter();
 int i=-1;
 while ((i=reader.read())!=-1)
 {
   writer.write(i);
  }
  reader.close();
  writer.close();
  }
 
  While doing that it raise this Exception:
   EXCEPTION---
   --
   --
   
  
   java.io.IOException: Stream closed at
   java.io.CharArrayReader.ensureOpen(CharArrayReader.java:65) at
   java.io.CharArrayReader.read(CharArrayReader.java:95) at
   java.io.BufferedReader.fill(BufferedReader.java:136) at
   java.io.BufferedReader.read(BufferedReader.java:157) at
   org.apache.fop.apps.Driver.render(Driver.java:557)
   
   --
 
  I need to know the reason or is there any other method to convert this
  and access the content of this inputSource?
 
  Thanx
  Harshini
 
 
 
  -Original Message-
  From: Jeremias Maerki [mailto:[EMAIL PROTECTED]
  Sent: Thursday, April 05, 2007 12:11 AM
  To: fop-users@xmlgraphics.apache.org
  Subject: Re: Convert InputSource into a Character array
 
  I don't understand what you're trying to do. Maybe you should explain
  that before going into technical details.
 
  On 04.04.2007 06:08:53 Harshini Madurapperuma wrote:
   Hi All;
  
   In fop Driver class there is a method called
  
   public synchronized void render(XMLReader parser, InputSource source)
   throws FOPException {
  
 }
  
   Is there a way to convert that InputSource source back into a
   character array within that render class? I tried to do it by this
   way but it throws a Stream Closed Exception.
   
   --
   --
   --
   if (source.getCharacterStream() != null) {
 BufferedReader reader = new
   BufferedReader(source.getCharacterStream());
 CharArrayWriter writer=new CharArrayWriter();
 int i=-1;
 while ((i

RE: Convert InputSource into a Character array

2007-04-04 Thread Sascha Schmidt
Hi all,

I assume Harshini needs to get the original XML-String from a
CharArrayReader (after rendering), which he used to equip the InputSource.
IMHO there is no chance to get the XML-String back, because
CharArrayReader.close() sets the internal Char-Buffer, which holds the
XML-String, to null. Thus one would either need to introduce a new attribute
somewhere in Harshinis class/code or extending class InputSource. I would
prefer the second method. This should give you a start point:

class MyInputSource extends InputSource{
  
  private String xml;

  public MyInputSource(String xml){
super(new CharArrayReader(xml));
  }

  public String getXML(){
return this.xml;
  }
}


Somewhere later...

((MyInputSource) source).getXML()

returns the xml.

Note that the code above is not tested, just typed in Outlook. ;-)

Cheers,
Sascha

PS: Of course it is correct that FOP closes the stream after processing it.
 
 
  NORTHBIT
RTF to XSL-FO, Reporting
Dipl. Inf. Sascha Schmidt
[EMAIL PROTECTED]
  www.northbit.de


 -Original Message-
 From: Harshini Madurapperuma [mailto:[EMAIL PROTECTED]
 Sent: Thursday, April 05, 2007 5:18 AM
 To: fop-users@xmlgraphics.apache.org
 Subject: RE: Convert InputSource into a Character array
 
 Hi;
 
 I have this character array, I converted that character array into to a
 InputSource and passed it as a parameter to a  render(XMLReader parser,
 InputSource source) method in the DRIVER class in fop.
 
 Within that render class I need to convert that InputSource (source)
 back into a character array (after doing some modifications inside that
 method). I tried to convert that as follows:
 
  if (source.getCharacterStream() != null) {
  BufferedReader reader = new
 BufferedReader(source.getCharacterStream());
CharArrayWriter writer=new CharArrayWriter();
int i=-1;
while ((i=reader.read())!=-1)
{
  writer.write(i);
 }
 reader.close();
 writer.close();
 }
 
 While doing that it raise this Exception:
  EXCEPTION-
  --
  
 
  java.io.IOException: Stream closed at
  java.io.CharArrayReader.ensureOpen(CharArrayReader.java:65) at
  java.io.CharArrayReader.read(CharArrayReader.java:95) at
  java.io.BufferedReader.fill(BufferedReader.java:136) at
  java.io.BufferedReader.read(BufferedReader.java:157) at
  org.apache.fop.apps.Driver.render(Driver.java:557)
  --
 
 I need to know the reason or is there any other method to convert this and
 access the content of this inputSource?
 
 Thanx
 Harshini
 
 
 
 -Original Message-
 From: Jeremias Maerki [mailto:[EMAIL PROTECTED]
 Sent: Thursday, April 05, 2007 12:11 AM
 To: fop-users@xmlgraphics.apache.org
 Subject: Re: Convert InputSource into a Character array
 
 I don't understand what you're trying to do. Maybe you should explain that
 before going into technical details.
 
 On 04.04.2007 06:08:53 Harshini Madurapperuma wrote:
  Hi All;
 
  In fop Driver class there is a method called
 
  public synchronized void render(XMLReader parser, InputSource source)
  throws FOPException {
 
  }
 
  Is there a way to convert that InputSource source back into a
  character array within that render class? I tried to do it by this way
  but it throws a Stream Closed Exception.
  --
  --
  --
  if (source.getCharacterStream() != null) {
  BufferedReader reader = new
  BufferedReader(source.getCharacterStream());
CharArrayWriter writer=new CharArrayWriter();
int i=-1;
while ((i=reader.read())!=-1)
{
  writer.write(i);
 }
 reader.close();
 writer.close();
 }
  --
  --
  
  EXCEPTION-
  --
  
 
  java.io.IOException: Stream closed at
  java.io.CharArrayReader.ensureOpen(CharArrayReader.java:65) at
  java.io.CharArrayReader.read(CharArrayReader.java:95) at
  java.io.BufferedReader.fill(BufferedReader.java:136) at
  java.io.BufferedReader.read(BufferedReader.java:157) at
  org.apache.fop.apps.Driver.render(Driver.java:557)
  --
  --
  -
 
  I'm using java as the language. Pls ur help will be greatly
  appreciated Thanx Harshini.
 
 
 Jeremias Maerki
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED

Optional hyphens in XSL-FO

2006-03-17 Thread Sascha Schmidt








Hi FOPies,



Im wondering if optional hyphen (like =
in Latex) are included in the XSL-FO specification, I couldnt find
anything. :-( My product is converting RTF into XSL-FO and since RTF can
contain optional hyphens, we want to keep them in XSL-FO (if hyphenation is set
to true). I know that this question is not really FOP related, but maybe somebody
of you has an idea? 



Thanks and cheers,

Sascha 








smime.p7s
Description: S/MIME cryptographic signature


RE: Performance: Caching Fonts, stylesheets

2005-12-01 Thread Sascha Schmidt
Title: Performance: Caching Fonts, stylesheets



Hi,

FOP is not using anystylesheetto render a 
pureXSL-FO document into PDF.Do you create a temporary XSL-FO file 
with RTF2FO or are you sending SAX-Events or a DOM to FOP? 

BTW, we are also distributing an RTF to XSL-FO processor, 
called JFO,that already comes with integrationfor FOP and other 
renderers. We are sending SAX-Events to FOP immediatelly after converting from 
RTF to XSL-FO. This saves a lot of time, because no XMLstreammust be 
parsed. I would be happy if you could download the latest build of JFO and make 
some tests. ;-)

Cheers,
Sascha


NORTHBITSascha 
Schmidt
[EMAIL PROTECTED]
www.northbit.de



From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] Sent: Thursday, 
December 01, 2005 4:15 PMTo: 
fop-users@xmlgraphics.apache.orgSubject: Performance: Caching Fonts, 
stylesheets

Hi, 
currently I try to to increase the performance 
in my FO2PDF process. . 
I have a complex 2 page rtf document, 
which is converted manually by RTF2FO. The FO to PDF process takes about 4 secs. 
I am using already a driver 
pool. 
Removing the true type fonts in the config xml 
saves approximately 1 second. Can these fonts be cached somewhow ? 
Is FOP using xslt to render the PDF ? Would a 
cashed stylesheet then be an optimization ? 
Is there anything else I can do ? 
Thanx, Thomas 


RE: Long Table repeat header

2005-11-22 Thread Sascha Schmidt
Hi,

Yes, you are right, the specification says An fo:retrieve-marker is only
permitted as the descendant of an fo:static-content.. But nevertheless it
works with FOP 0.20.5. ;-) 
But maybe the FOP extension (already mentioned by Pascal Sancho) is a
cleaner solution:
http://xmlgraphics.apache.org/fop/0.20.5/extensions.html#table-continue-labe
l

I wonder, why fo:retrieve-marker is restricted to static content and not
allowed in the flow. Does anybody has an explanation?

Cheers,
Sascha


-Original Message-
From: Prakash R [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 22, 2005 6:46 PM
To: fop-users@xmlgraphics.apache.org
Subject: RE: Long Table repeat header

Isn't it true that fo:retrieve-marker can only be used within a
fo:static-content? If so, how will this work?
Are there any other options?

Thank you.
Prakash

--- Sascha Schmidt [EMAIL PROTECTED] wrote:

 Hi,
 
 fo:marker and fo:retrieve-marker are your best friends here. 
 Example:
 
 fo:flow
   fo:marker
 marker-class-name=continued/fo:marker
   ...
   fo:table
fo:table-header
 fo:table-row
  fo:table-cellHeader fo:retrieve-marker 
 retrieve-class-name=continued//fo:table-cell
 /fo:table-row
/fo:table-header   
fo:table-body
 fo:table-row
  fo:table-cell
   fo:marker
 marker-class-name=continuedcont./fo:marker
   content...
 /fo:table-row
/fo:table-body
   /fo:table
 /fo:flow
 
 Cheers,
 Sascha
 
 -Original Message-
 From: Prakash R [mailto:[EMAIL PROTECTED]
 Sent: Saturday, November 19, 2005 8:23 AM
 To: fop-users@xmlgraphics.apache.org
 Subject: Long Table repeat header
 
 I have a document (FO-PDF) made up of multiple tables.
 Some of these tables are long and span multiple pages.
 I want to be able to repeat the header on the next page. But at the 
 same time I want to add the word continued for any subsequent pages. 
 i.e.
 
 col1   col2   col3
 TABLE HEADER
 ---
 jjf   jflkds   jflkds
 fjs   jflsda   jklfds
 jjf   jflkds   jflkds
 fjs   jflsda   jklfds
 jjf   jflkds   jflkds
 fjs   jflsda   jklfds
 --- page break 
 col1   col2   col3
 TABLE HEADER (CONTD)
 ---
 fjs   jflsda   jklfds
 fjs   jflsda   jklfds
 
 col1   col2   col3
 TABLE HEADER2
 ---
 fjs   jflsda   jklfds
 fjs   jflsda   jklfds
 fjs   jflsda   jklfds
 --- page break 
 col1   col2   col3
 TABLE HEADER3
 ---
 fjs   jflsda   jklfds
 fjs   jflsda   jklfds
 fjs   jflsda   jklfds
 
 Is there anything in FO that will allow repeating of table header and 
 also modification of table header in subsequent pages?
 
 Thank you.
 Prakash
 

-
 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]
 
 


-
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]



Combining text-decorations

2005-09-29 Thread Sascha Schmidt
Hi!

It seems that combining text-decorations (e.g. text-decoration=underline
line-through) is currently unsupported in Fop 0.20.5. Is that right?

Cheers,
Sascha




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



line-spacing and line-height

2005-09-29 Thread Sascha Schmidt
Hi again,

To set spacing between lines of a block I'm using the line-height property:

fo:block line-height=36ptfo:inline font-size=12ptHello
world/fo:inline.../fo:block

The content (Hello world) of a line seems to be centered vertically. Now I
want the text to be displayed at top of the line. If the line contains
inline objects with different heights, the largest inline object should set
the baseline. Example:

--- Top edge of block --
Hello world


- - - - - - next line - - - - - -  - - -
   BIG TEXT
Small text BIG TEXT 

--- Bottom edge of block ---

Does anybody have an idea?

Sascha



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



RE: Combining text-decorations

2005-09-29 Thread Sascha Schmidt
Thanks Douglas! 

-Original Message-
From: Oosterbaan, Douglas S. (LNG-DAY)
[mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 29, 2005 3:50 PM
To: 'fop-users@xmlgraphics.apache.org'
Subject: RE: Combining text-decorations

No, we ran into this as well.  To fix it, we modified the file:
build/src/codegen/foproperties.xml

Starting at line 1351 has:
  nametext-decoration/name
  inheritedfalse/inherited
  datatypeEnum/datatype
  enumeration
value const=NONEnone/value
value const=UNDERLINEunderline/value
value const=OVERLINEoverline/value
value const=LINE_THROUGHline-through/value
value const=BLINKblink/value
value const=NO_UNDERLINEno-underline/value
value const=NO_OVERLINEno-overline/value
value const=NO_LINE_THROUGHno-line-through/value
value const=NO_BLINKno-blink/value

After this add:
value const=UNDERLINE_LINE_THROUGHunderline line-through/value
value const=UNDERLINE_NO_LINE_THROUGHunderline
no-line-through/value
value const=NO_UNDERLINE_LINE_THROUGHno-underline
line-through/value
value const=NO_UNDERLINE_NO_LINE_THROUGHno-underline
no-line-through/value


Then continues the existing code:
  /enumeration
  defaultnone/default



-Original Message-
From: Sascha Schmidt [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 29, 2005 2:52 AM
To: fop-users@xmlgraphics.apache.org
Subject: Combining text-decorations

Hi!

It seems that combining text-decorations (e.g. text-decoration=underline
line-through) is currently unsupported in Fop 0.20.5. Is that right?

Cheers,
Sascha




-
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]




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