can not create an FOP instance anymore

2007-08-06 Thread Baeckham
Hi,

I am using FOp to create PDF documents dynamically. Suddenly it stopped to 
work. I do't know why. The reason is that a instance of the class 
org.apache.fop.apps.Fop can not be created. Why??

The FopFactory an the FOUserAgent are created but not the Fop itself.

Here the code:
private Fop getFop(String format, OutputStream out) throws FOPException {
if (fop == null) {
FopFactory fopFactory = FopFactory.newInstance();
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, 
foUserAgent, out);
}
return fop;
}

Maybe I changed something unnoticed. A library or something. Debugging the FOP 
shows no problems, the DefaultHandler is build. But the call 

fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);

does not return anything  ?

Thanx for any hints. I am really at a loss

Steffen


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



One question about PS extesions and string constants usage

2007-08-06 Thread Andrejus Chaliapinas
Hi,

While looking for extensions sample implemented for PS, I've found that such
string as ps-setup-code is defined as private static in
org.apache.fop.render.ps.extensions.PSSetupCode as:

private static final String ELEMENT = ps-setup-code;

but then later used as string comparison in let say
PSExtensionElementMapping here:

foObjs.put(ps-setup-code, new PSSetupCodeMaker());

Do we have anything preventing from making that ELEMENT public and then
referencing in all other parts of the code? I hope that then whole code
could be more understandable.

Andrejus


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



Re: One question about PS extesions and string constants usage

2007-08-06 Thread Adrian Cumiskey

Hi Andrejus,

No I don't think there anything preventing you from making this change, 
 although I would probably go for declaring this as a protected 
variable and making it package visible (as it is only ever used in 
org.apache.fop.render.ps.extensions).  I would suggest you go ahead and 
submit a patch.


Adrian.

Andrejus Chaliapinas wrote:

Hi,

While looking for extensions sample implemented for PS, I've found that such
string as ps-setup-code is defined as private static in
org.apache.fop.render.ps.extensions.PSSetupCode as:

private static final String ELEMENT = ps-setup-code;

but then later used as string comparison in let say
PSExtensionElementMapping here:

foObjs.put(ps-setup-code, new PSSetupCodeMaker());

Do we have anything preventing from making that ELEMENT public and then
referencing in all other parts of the code? I hope that then whole code
could be more understandable.

Andrejus


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



RE: One question about PS extesions and string constants usage

2007-08-06 Thread Andrejus Chaliapinas
Hi Adrian,

 I would suggest you go ahead and
 submit a patch.

Please find related patch attached done over today's fop trunk code. Not
sure who could commit it though to the code.

Andrejus
Index: 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java
===
--- 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java
   (revision 562199)
+++ 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java
   (working copy)
@@ -39,8 +39,8 @@
 protected void initialize() {
 if (foObjs == null) {
 foObjs = new java.util.HashMap();
-foObjs.put(ps-setup-code, new PSSetupCodeMaker());
-foObjs.put(ps-page-setup-code, new PSPageSetupCodeMaker());
+foObjs.put(PSSetupCodeElement.ELEMENT, new PSSetupCodeMaker());
+foObjs.put(PSPageSetupCodeElement.ELEMENT, new 
PSPageSetupCodeMaker());
 }
 }
 
Index: 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSPageSetupCodeElement.java
===
--- 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSPageSetupCodeElement.java
  (revision 562199)
+++ 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSPageSetupCodeElement.java
  (working copy)
@@ -29,6 +29,8 @@
  */
 public class PSPageSetupCodeElement extends AbstractPSExtensionObject {
 
+protected static final String ELEMENT = ps-page-setup-code;
+
 /**
  * Main constructor
  * @param parent parent FO node
@@ -47,7 +49,7 @@
 
 /** [EMAIL PROTECTED] */
 public String getLocalName() {
-return ps-page-setup-code;
+return ELEMENT;
 }
 
 }
Index: 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSSetupCodeElement.java
===
--- 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSSetupCodeElement.java
  (revision 562199)
+++ 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSSetupCodeElement.java
  (working copy)
@@ -29,6 +29,8 @@
  */
 public class PSSetupCodeElement extends AbstractPSExtensionObject {
 
+protected static final String ELEMENT = ps-setup-code;
+
 /**
  * Main constructor
  * @param parent parent FO node
@@ -47,7 +49,7 @@
 
 /** [EMAIL PROTECTED] */
 public String getLocalName() {
-return ps-setup-code;
+return ELEMENT;
 }
 
 }
Index: 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java
===
--- 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java
  (revision 562199)
+++ 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java
  (working copy)
@@ -49,7 +49,7 @@
 if (PSSetupCode.CATEGORY.equals(uri)) {
 lastAttributes = attributes;
 handled = true; 
-if (ps-setup-code.equals(localName)) {
+if (PSSetupCodeElement.ELEMENT.equals(localName)) {
 //handled in endElement
 } else {
 handled = false;
@@ -69,7 +69,7 @@
 /** [EMAIL PROTECTED] */
 public void endElement(String uri, String localName, String qName) throws 
SAXException {
 if (PSSetupCode.CATEGORY.equals(uri)) {
-if (ps-setup-code.equals(localName)) {
+if (PSSetupCodeElement.ELEMENT.equals(localName)) {
 String name = lastAttributes.getValue(name);
 this.returnedObject = new PSSetupCode(name, 
content.toString());
 }
Index: 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java
===
--- 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java
 (revision 562199)
+++ 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java
 (working copy)
@@ -92,7 +92,6 @@
 }
 
 private static final String ATT_NAME = name;
-private static final String ELEMENT = ps-setup-code;
 
 /** [EMAIL PROTECTED] */
 public void toSAX(ContentHandler handler) throws SAXException {
@@ -100,7 +99,7 @@
 if (name != null  name.length()  0) {
 atts.addAttribute(null, ATT_NAME, ATT_NAME, CDATA, name);
 }
-handler.startElement(CATEGORY, ELEMENT, ELEMENT, atts);
+handler.startElement(CATEGORY, PSSetupCodeElement.ELEMENT, 
PSSetupCodeElement.ELEMENT, atts);
 if (content != null  content.length()  0) {
 char[] chars = 

Re: One question about PS extesions and string constants usage

2007-08-06 Thread Adrian Cumiskey

Hi Andrejus,

Nice patch :-).  It would make it easier for one of the FOP committers 
to process it if you could submit it to the FOP patch queue at 
http://issues.apache.org/bugzilla/enter_bug.cgi.


Adrian.

Andrejus Chaliapinas wrote:

Hi Adrian,


I would suggest you go ahead and
submit a patch.


Please find related patch attached done over today's fop trunk code. Not
sure who could commit it though to the code.

Andrejus




Index: 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java
===
--- 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java
   (revision 562199)
+++ 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java
   (working copy)
@@ -39,8 +39,8 @@
 protected void initialize() {
 if (foObjs == null) {
 foObjs = new java.util.HashMap();
-foObjs.put(ps-setup-code, new PSSetupCodeMaker());
-foObjs.put(ps-page-setup-code, new PSPageSetupCodeMaker());
+foObjs.put(PSSetupCodeElement.ELEMENT, new PSSetupCodeMaker());
+foObjs.put(PSPageSetupCodeElement.ELEMENT, new 
PSPageSetupCodeMaker());
 }
 }
 
Index: D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSPageSetupCodeElement.java

===
--- 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSPageSetupCodeElement.java
  (revision 562199)
+++ 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSPageSetupCodeElement.java
  (working copy)
@@ -29,6 +29,8 @@
  */
 public class PSPageSetupCodeElement extends AbstractPSExtensionObject {
 
+protected static final String ELEMENT = ps-page-setup-code;
+
 /**

  * Main constructor
  * @param parent parent FO node
@@ -47,7 +49,7 @@
 
 /** [EMAIL PROTECTED] */

 public String getLocalName() {
-return ps-page-setup-code;
+return ELEMENT;
 }
 
 }

Index: 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSSetupCodeElement.java
===
--- 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSSetupCodeElement.java
  (revision 562199)
+++ 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSSetupCodeElement.java
  (working copy)
@@ -29,6 +29,8 @@
  */
 public class PSSetupCodeElement extends AbstractPSExtensionObject {
 
+protected static final String ELEMENT = ps-setup-code;
+
 /**

  * Main constructor
  * @param parent parent FO node
@@ -47,7 +49,7 @@
 
 /** [EMAIL PROTECTED] */

 public String getLocalName() {
-return ps-setup-code;
+return ELEMENT;
 }
 
 }

Index: 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java
===
--- 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java
  (revision 562199)
+++ 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java
  (working copy)
@@ -49,7 +49,7 @@
 if (PSSetupCode.CATEGORY.equals(uri)) {
 lastAttributes = attributes;
 handled = true; 
-if (ps-setup-code.equals(localName)) {

+if (PSSetupCodeElement.ELEMENT.equals(localName)) {
 //handled in endElement
 } else {
 handled = false;
@@ -69,7 +69,7 @@
 /** [EMAIL PROTECTED] */
 public void endElement(String uri, String localName, String qName) throws 
SAXException {
 if (PSSetupCode.CATEGORY.equals(uri)) {
-if (ps-setup-code.equals(localName)) {
+if (PSSetupCodeElement.ELEMENT.equals(localName)) {
 String name = lastAttributes.getValue(name);
 this.returnedObject = new PSSetupCode(name, 
content.toString());
 }
Index: 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java
===
--- 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java
 (revision 562199)
+++ 
D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java
 (working copy)
@@ -92,7 +92,6 @@
 }
 
 private static final String ATT_NAME = name;

-private static final String ELEMENT = ps-setup-code;
 
 /** [EMAIL PROTECTED] */

 public void toSAX(ContentHandler handler) throws SAXException {
@@ -100,7 +99,7 @@
 if (name != null  name.length()  0) {
 

RE: One question about PS extesions and string constants usage

2007-08-06 Thread Andrejus Chaliapinas
Hi Adrian,

 Nice patch :-).  It would make it easier for one of the FOP committers
 to process it if you could submit it to the FOP patch queue at
 http://issues.apache.org/bugzilla/enter_bug.cgi.

It's now created as patch for the newly registered Bug 43042. Hope someone
could commit that.

Andrejus


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



Repetition of pre formatted strings when wrap-otion=wrap

2007-08-06 Thread DavidJKelly

Has anyone seen this problem?  From the DITA-OT xsl:fo stylesheets, the
attribute set for pre results in a certain set of attributes (shown in
example below).  The contained text is repeated in the output with a #
character where the linebreaks were, then ends with broken text.  For
example this fo source... 

fo:block space-before=1.2em space-after=0.8em
white-space-treatment=preserve white-space-collapse=false
linefeed-treatment=preserve wrap-option=wrap background-color=#f0f0f0
font-family=Courier line-height=106% font-size=9ptcodeblock w/hard
return:
and another one:
blah/fo:block

...results in this output in the PDF:

codeblock w/hard return:#and
another one:#blah
codeblock w/hard re
turn:#and another
oth

However, when I set wrap-option=no-wrap, the text renders correctly.

I would like to be able to wrap pre formatted text if it encounters a text
margin if possible.  Would this be characterized as a bug, or is there some
other combination of settings that would be required?

Thank you as always for the help,
David


-- 
View this message in context: 
http://www.nabble.com/Repetition-of-%22pre%22-formatted-strings-when-wrap-otion%3D%22wrap%22-tf4224485.html#a12017331
Sent from the FOP - Users mailing list archive at Nabble.com.


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



RE: (Postscript) transformation of block-container

2007-08-06 Thread Peter Coppens

 Give your block-container an id. If you render your document using -at,
 you get an XML file. Locate the block element that has a prod-id
 attribute with the id you've given the block-container. There may be
 more than one. Choose the one that has is-viewport-area=true. There,
 you'll find an attribute called ctm. That's a transformation matrix.
 If you manipulate it you may be able to achieve the effect you seek.
 After modifying the XML you can render the XML file to PostScript using
 -atin instead of -fo.
 
 More info: http://xmlgraphics.apache.org/fop/0.93/intermediate.html
 
 HTH
Yes it does. Thanks for the tip. I am most certainly going to try this.

Finally got around trying this. It works...more or less.

If I start from 

  fo:block-container id='totransform' height=100.0pt width=100.0pt 
  overflow=hidden background-color=rgb(0,0,255)
  position=absolute top=30pt left=30pt  
fo:block linefeed-treatment=ignore white-space-treatment=ignore
white-space-collapse=true  
   color=cmyk(0,0,1,0) font-size=8pt background-color=rgb(0,0,0)
jaja
/fo:block
/fo:block-container

and change the ctm as in 


block ipd=10 bpd=10
  ipda=10 bpda=10 bap=0 0 0 0
  prod-id=totransform is-viewport-area=true
  background=color=#ff
  bkg-color=java.awt.Color[r=0,g=0,b=255]
  left-position=3 top-position=3
  ctm=[0.7071 0.7071 -0.7071 0.7071 3.0 3.0]
  clipped=true positioning=absolute


This does not rotate the 'background' of the block-container, but only its'
'content'.

http://www.nabble.com/file/p12018237/fo.pdf fo.pdf 

Would anyone have any thoughts?

Thanks,

Peter
-- 
View this message in context: 
http://www.nabble.com/%28Postscript%29-transformation-of-block-container-tf3632392.html#a12018237
Sent from the FOP - Users mailing list archive at Nabble.com.


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



Nested tables - enclosing table height not being calculated properly?

2007-08-06 Thread Charlie Flowers
I figured I should give this a shot before I submitted a bug report.  My
stylesheet produces a table which has another table nested inside of it.  When
the child table cannot be contained on a single page (either because it is
larger than a single page itself, or because the parent table's row begins near
the end of the page), the child table extends for exactly one row beyond the end
of the parent table.  It doesn't seem as though the child table is intruding
into the region-after, but rather that the parent table-row is cutting off
prematurely.  Both of the tables are relatively simple, i.e. I haven't added any
keep, break, widow, or orphan conditions.  In FOP 0.20.5, the PDF renders
correctly - the problem only occurs in FOP 0.93.  

For example:

H = header
F = footer
P = Parent table row boundary
c = Child table row boundary

H

P
P   P
P c P
P c row1  c P
P c P
P c row2  c P
P c P
P c row3  c P
PPcPP
  c row4  c
  c 
F
 PAGEBREAK
H

P
P   P
P c P
P c row5  c P
P c P
P


F

Any ideas?

Thanks in advance,

Charlie Flowers


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



Problem: external-graphics - jpeg - color lookup tables

2007-08-06 Thread Reiner Hoppe

Hello people,

I've got a problem with the external-graphic in a pdf-file. This graphic 
is saved as a jpeg. I found out that there are some
problems with some unusual color lookup tables and color profiles, like 
it is described on 
http://xmlgraphics.apache.org/fop/0.20.5/graphics.html#jpeg
The main problem is that the following text after the image isn't 
displayed. Is there a way to specify the output  to 24-bit like it is 
mentioned on

the side above? Or perhaps a way to detect or catch the problem?

Thanks
Reiner

--
junior software entwickler

denkwerk gmbh | vogelsanger straße 66 | d-50823 köln
telefon +49 221 2942 100 | telefax +49 221 2942 101
GF: Axel Schmiegelow, Marco Zingler, Jochen Schlaier, Frank Zimpel
HRB 32063 Amtsgericht Köln  -  www.denkwerk.com 



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



FOP and control sequences for thr printer

2007-08-06 Thread Dirk Eiden

Is there any way to send (PCL) control sequences to the printer using FOP?

I need to print the first page of the document from paper tray 1 (cover 
page) and the rest of the document from paper tray 2.


D. Eiden

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



Re: FOP and control sequences for thr printer

2007-08-06 Thread Warren Young

Dirk Eiden wrote:

Is there any way to send (PCL) control sequences to the printer using FOP?

I need to print the first page of the document from paper tray 1 (cover 
page) and the rest of the document from paper tray 2.


Why not just render out the first and subsequent pages to separate 
documents, then use external mechanisms to select the paper source for each?


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