Re: How to keep pagenumber over several page-sequences

2007-11-14 Thread Chris Bowditch

Michael Niemann wrote:


hello,
I've split up my document into several page-sequences for better 
performance.


xsl:for-each select=documentContent/chapter
fo:page-sequence master-reference=ContentPageMaster 
initial-page-number=1 force-page-count=no-force

  fo:static-content flow-name=xsl-region-after
fo:blockfo:page-number //fo:block
  /fo:static-content
  fo:flow flow-name=xsl-region-body
fo:block font-size=24 font-weight=bold 
border-bottom=solid black 1px id={generate-id()} 
margin-bottom=20pxxsl:value-of select=@page //fo:block

fo:blockxsl:apply-templates //fo:block
  /fo:flow 
/fo:page-sequence

  /xsl:for-each
/fo:root
  /xsl:template

As you can easily see each chapter now starts with page 1. Is it 
possible to pass the pagenumber between those sequences without losing 
all the performance gain I got from spolitting up the chapter into 
sequences?


Don't set initial-page-number=1 on any page-sequence except the first. 
To do this you will need to introduce an xsl:if. Try something like the 
following (caveat: completely untested and provided with no warranty!)


xsl:for-each select=documentContent/chapter
fo:page-sequence master-reference=ContentPageMaster 
force-page-count=no-force

xsl:if test=position()==1
xsl:attribute 
name=initial-page-number1/xsl:attribute
/xsl:if
   fo:static-content flow-name=xsl-region-after
 fo:blockfo:page-number //fo:block

etc

Chris



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



The number of this PDFNumber must not be empty

2007-11-14 Thread altmax

Hello,

i have a problem with apache fop 0.94.

My os is windows xp , my application server oracle 9ias oc4j1.0.2.2.1,
jdk1.3.1_09 with jre 1.3.1_09.

Class java is:
.
import
..

public class Case2PDF {

// configure fopFactory as desired
private FopFactory fopFactory = FopFactory.newInstance();
 
public void convertCase2PDF(CaseVO caseVO, File xslt, File pdf)
throws Exception, IOException, FOPException,
TransformerException {

// Setup output
OutputStream out = new java.io.FileOutputStream(pdf);
out = new java.io.BufferedOutputStream(out);

try {
//Setup user agent
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
PDFRenderer pdfrenderer = new PDFRenderer();
pdfrenderer.setUserAgent(foUserAgent);
foUserAgent.setRendererOverride(pdfrenderer);

fopFactory.addElementMapping(new FOElementMapping());
fopFactory.addElementMapping(new SVGElementMapping());
fopFactory.addElementMapping(new
BatikExtensionElementMapping());
fopFactory.addElementMapping(new ExtensionElementMapping());
fopFactory.addElementMapping(new XMPElementMapping());
fopFactory.addElementMapping(new RDFElementMapping());
fopFactory.addElementMapping(new PSExtensionElementMapping());

// Construct fop with desired output format
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent,
out);

// Setup XSLT
TransformerFactory factory = new
org.apache.xalan.processor.TransformerFactoryImpl();//TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(new
StreamSource(xslt));

CaseForm caseForm = new CaseForm();
caseForm.map(caseVO);

// Setup input for XSLT transformation
Source src = new SAXSource(new CaseXMLReader(),new
CaseInputSource(caseForm));

//System.out.println(input source:
+((SAXSource)src).getInputSource().getByteStream().available());

// Resulting SAX events (the generated FO) must be piped through
to FOP
Result res = new SAXResult(fop.getDefaultHandler());

// Start XSLT transformation and FOP processing
transformer.transform(src, res);
}catch(Exception ex){
   System.out.println(Case2pdf - exception in export:  +
ex.getMessage());
   ex.printStackTrace();
   throw new Exception(ex.getMessage());
}
finally {
out.close();
}

   }

}

.

at runtime, I get a error from Apache FOP (The number of this PDFNumber must
not be empty):

-71066 [HttpRequestHandler-6502834] ERROR org.apache.fop.fo.FOTreeBuilder  -
java.lang.IllegalArgumentException: The numbe
-Case2pdf - exception in export: java.lang.IllegalArgumentException: The
number of this PDFNumber must not be empty
javax.xml.transform.TransformerException:
java.lang.IllegalArgumentException: The number of this PDFNumber must not be
emp
at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1226)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:638)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)
at com.bms.util.pdf.Case2PDF.convertCase2PDF(Case2PDF.java:93)
at
com.bms.presentation.action.assurance.ExportPDFAction.execute(ExportPDFAction.java:84)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at
com.bms.presentation.servlet.BmsActionServlet.service(BmsActionServlet.java:222)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:721)
at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at 

Re: The number of this PDFNumber must not be empty

2007-11-14 Thread Jeremias Maerki
Not without the FO file to reproduce the problem, no. You can do some
more testing yourself by running the same document on the command-line.
It's probably a good idea to do such a test outside the Oracle server to
make sure it's not something from Oracle interfering here. The Oracle
server caused some grief in the past because of bugs in the JAXP
implementation (XML parser, XSLT processor).

Jeremias Maerki



On 14.11.2007 10:40:28 altmax wrote:
 
 Hello,
 
 i have a problem with apache fop 0.94.
 
 My os is windows xp , my application server oracle 9ias oc4j1.0.2.2.1,
 jdk1.3.1_09 with jre 1.3.1_09.
 
 Class java is:
 .
 import
 ..
 
 public class Case2PDF {
 
 // configure fopFactory as desired
 private FopFactory fopFactory = FopFactory.newInstance();
  
 public void convertCase2PDF(CaseVO caseVO, File xslt, File pdf)
 throws Exception, IOException, FOPException,
 TransformerException {
 
 // Setup output
 OutputStream out = new java.io.FileOutputStream(pdf);
 out = new java.io.BufferedOutputStream(out);
 
 try {
 //Setup user agent
 FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
 PDFRenderer pdfrenderer = new PDFRenderer();
 pdfrenderer.setUserAgent(foUserAgent);
 foUserAgent.setRendererOverride(pdfrenderer);
 
 fopFactory.addElementMapping(new FOElementMapping());
 fopFactory.addElementMapping(new SVGElementMapping());
 fopFactory.addElementMapping(new
 BatikExtensionElementMapping());
 fopFactory.addElementMapping(new ExtensionElementMapping());
 fopFactory.addElementMapping(new XMPElementMapping());
 fopFactory.addElementMapping(new RDFElementMapping());
 fopFactory.addElementMapping(new PSExtensionElementMapping());
 
 // Construct fop with desired output format
 Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent,
 out);
 
 // Setup XSLT
 TransformerFactory factory = new
 org.apache.xalan.processor.TransformerFactoryImpl();//TransformerFactory.newInstance();
 Transformer transformer = factory.newTransformer(new
 StreamSource(xslt));
 
 CaseForm caseForm = new CaseForm();
 caseForm.map(caseVO);
 
 // Setup input for XSLT transformation
 Source src = new SAXSource(new CaseXMLReader(),new
 CaseInputSource(caseForm));
 
 //System.out.println(input source:
 +((SAXSource)src).getInputSource().getByteStream().available());
 
 // Resulting SAX events (the generated FO) must be piped through
 to FOP
 Result res = new SAXResult(fop.getDefaultHandler());
 
 // Start XSLT transformation and FOP processing
 transformer.transform(src, res);
 }catch(Exception ex){
System.out.println(Case2pdf - exception in export:  +
 ex.getMessage());
ex.printStackTrace();
throw new Exception(ex.getMessage());
 }
 finally {
 out.close();
 }
 
}
 
 }
 
 .
 
 at runtime, I get a error from Apache FOP (The number of this PDFNumber must
 not be empty):
 
 -71066 [HttpRequestHandler-6502834] ERROR org.apache.fop.fo.FOTreeBuilder  -
 java.lang.IllegalArgumentException: The numbe
 -Case2pdf - exception in export: java.lang.IllegalArgumentException: The
 number of this PDFNumber must not be empty
 javax.xml.transform.TransformerException:
 java.lang.IllegalArgumentException: The number of this PDFNumber must not be
 emp
 at
 org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1226)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:638)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)
 at com.bms.util.pdf.Case2PDF.convertCase2PDF(Case2PDF.java:93)
 at
 com.bms.presentation.action.assurance.ExportPDFAction.execute(ExportPDFAction.java:84)
 at
 org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
 at
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
 at
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 at
 org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at
 com.bms.presentation.servlet.BmsActionServlet.service(BmsActionServlet.java:222)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
 

Total page numbering example only for FOP 0.20.5

2007-11-14 Thread Gregan, Miroslav

Hi,

I found a document that is not up to date:

http://xmlgraphics.apache.org/fop/fo.html#fo-total-pages

A new example like the following should be added for FOP 0.94 (or
replace the current FOP 0.20.5)

class rendtest {

  public static void main(File fo, File pdf) {
OutputStream out = null;
try {
  FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
  out = new FileOutputStream(pdf);
  out = new BufferedOutputStream(out);
  Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent,
out);
  TransformerFactory factory = TransformerFactory.newInstance();
  Transformer transformer = factory.newTransformer();
  Source src = new StreamSource(fo);
  Result res = new SAXResult(fop.getDefaultHandler());
  transformer.transform(src, res);

  // Read total page number and set the FO's page-count parameter
  transformer.setParameter(page-count,
Integer.toString(fop.getResults().getPageCount()));

  transformer.transform(src, res);
}
catch( Exception e) {
  e.printStackTrace();
}
finally {
  if (out != null) {
out.close();
  }
}
  }
}

Cheers,

Miro

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



Re: The number of this PDFNumber must not be empty

2007-11-14 Thread altmax

Sure oracle interfering with fop, but can i use it with this application
server??

Where can i find this FO file??


Jeremias Maerki-2 wrote:
 
 Not without the FO file to reproduce the problem, no. You can do some
 more testing yourself by running the same document on the command-line.
 It's probably a good idea to do such a test outside the Oracle server to
 make sure it's not something from Oracle interfering here. The Oracle
 server caused some grief in the past because of bugs in the JAXP
 implementation (XML parser, XSLT processor).
 
 Jeremias Maerki
 
 
 
 On 14.11.2007 10:40:28 altmax wrote:
 
 Hello,
 
 i have a problem with apache fop 0.94.
 
 My os is windows xp , my application server oracle 9ias oc4j1.0.2.2.1,
 jdk1.3.1_09 with jre 1.3.1_09.
 
 Class java is:
 .
 import
 ..
 
 public class Case2PDF {
 
 // configure fopFactory as desired
 private FopFactory fopFactory = FopFactory.newInstance();
  
 public void convertCase2PDF(CaseVO caseVO, File xslt, File pdf)
 throws Exception, IOException, FOPException,
 TransformerException {
 
 // Setup output
 OutputStream out = new java.io.FileOutputStream(pdf);
 out = new java.io.BufferedOutputStream(out);
 
 try {
 //Setup user agent
 FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
 PDFRenderer pdfrenderer = new PDFRenderer();
 pdfrenderer.setUserAgent(foUserAgent);
 foUserAgent.setRendererOverride(pdfrenderer);
 
 fopFactory.addElementMapping(new FOElementMapping());
 fopFactory.addElementMapping(new SVGElementMapping());
 fopFactory.addElementMapping(new
 BatikExtensionElementMapping());
 fopFactory.addElementMapping(new ExtensionElementMapping());
 fopFactory.addElementMapping(new XMPElementMapping());
 fopFactory.addElementMapping(new RDFElementMapping());
 fopFactory.addElementMapping(new
 PSExtensionElementMapping());
 
 // Construct fop with desired output format
 Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,
 foUserAgent,
 out);
 
 // Setup XSLT
 TransformerFactory factory = new
 org.apache.xalan.processor.TransformerFactoryImpl();//TransformerFactory.newInstance();
 Transformer transformer = factory.newTransformer(new
 StreamSource(xslt));
 
 CaseForm caseForm = new CaseForm();
 caseForm.map(caseVO);
 
 // Setup input for XSLT transformation
 Source src = new SAXSource(new CaseXMLReader(),new
 CaseInputSource(caseForm));
 
 //System.out.println(input source:
 +((SAXSource)src).getInputSource().getByteStream().available());
 
 // Resulting SAX events (the generated FO) must be piped
 through
 to FOP
 Result res = new SAXResult(fop.getDefaultHandler());
 
 // Start XSLT transformation and FOP processing
 transformer.transform(src, res);
 }catch(Exception ex){
System.out.println(Case2pdf - exception in export:  +
 ex.getMessage());
ex.printStackTrace();
throw new Exception(ex.getMessage());
 }
 finally {
 out.close();
 }
 
}
 
 }
 
 .
 
 at runtime, I get a error from Apache FOP (The number of this PDFNumber
 must
 not be empty):
 
 -71066 [HttpRequestHandler-6502834] ERROR org.apache.fop.fo.FOTreeBuilder 
 -
 java.lang.IllegalArgumentException: The numbe
 -Case2pdf - exception in export: java.lang.IllegalArgumentException: The
 number of this PDFNumber must not be empty
 javax.xml.transform.TransformerException:
 java.lang.IllegalArgumentException: The number of this PDFNumber must not
 be
 emp
 at
 org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1226)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:638)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)
 at com.bms.util.pdf.Case2PDF.convertCase2PDF(Case2PDF.java:93)
 at
 com.bms.presentation.action.assurance.ExportPDFAction.execute(ExportPDFAction.java:84)
 at
 org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
 at
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
 at
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 at
 org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at
 

Re: The number of this PDFNumber must not be empty

2007-11-14 Thread Jeremias Maerki
Yes, it's possible to use FOP inside Oracle, but if you run into
certain problems (the one at hand is not normally one of them) you may
need to replace the XML support bundled with Oracle with Apache
Xerces/Xalan in order to avoid possible bugs in Oracle code. Please see
the mailing list archives for further information. My reaction is simply
triggered by your stating that you're running inside Oracle. But it
would really help to know if the same problem appears outside Oracle,
just to know on which side we have to look. Basic error finding strategy.

The FO (XSL-FO) file in your case is just virtual (actually a SAX
event stream). You get it by converting the XML file using the XSLT
stylesheet you have. You can also do:

fop -xml myfile.xml -xsl mystylesheet.xsl -pdf out.pdf

...on the command-line. But you know about that, don't you?

To get the FO file:
fop -xml myfile.xml -xsl mystylesheet.xsl -foout out.fo
(and you'd post the out.fo file here)

Jeremias Maerki



On 14.11.2007 11:27:50 altmax wrote:
 
 Sure oracle interfering with fop, but can i use it with this application
 server??
 
 Where can i find this FO file??
 
 
 Jeremias Maerki-2 wrote:
  
  Not without the FO file to reproduce the problem, no. You can do some
  more testing yourself by running the same document on the command-line.
  It's probably a good idea to do such a test outside the Oracle server to
  make sure it's not something from Oracle interfering here. The Oracle
  server caused some grief in the past because of bugs in the JAXP
  implementation (XML parser, XSLT processor).
  
  Jeremias Maerki
  
  
  
  On 14.11.2007 10:40:28 altmax wrote:
  
  Hello,
  
  i have a problem with apache fop 0.94.
  
  My os is windows xp , my application server oracle 9ias oc4j1.0.2.2.1,
  jdk1.3.1_09 with jre 1.3.1_09.
  
  Class java is:
  .
  import
  ..
  
  public class Case2PDF {
  
  // configure fopFactory as desired
  private FopFactory fopFactory = FopFactory.newInstance();
   
  public void convertCase2PDF(CaseVO caseVO, File xslt, File pdf)
  throws Exception, IOException, FOPException,
  TransformerException {
  
  // Setup output
  OutputStream out = new java.io.FileOutputStream(pdf);
  out = new java.io.BufferedOutputStream(out);
  
  try {
  //Setup user agent
  FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
  PDFRenderer pdfrenderer = new PDFRenderer();
  pdfrenderer.setUserAgent(foUserAgent);
  foUserAgent.setRendererOverride(pdfrenderer);
  
  fopFactory.addElementMapping(new FOElementMapping());
  fopFactory.addElementMapping(new SVGElementMapping());
  fopFactory.addElementMapping(new
  BatikExtensionElementMapping());
  fopFactory.addElementMapping(new ExtensionElementMapping());
  fopFactory.addElementMapping(new XMPElementMapping());
  fopFactory.addElementMapping(new RDFElementMapping());
  fopFactory.addElementMapping(new
  PSExtensionElementMapping());
  
  // Construct fop with desired output format
  Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,
  foUserAgent,
  out);
  
  // Setup XSLT
  TransformerFactory factory = new
  org.apache.xalan.processor.TransformerFactoryImpl();//TransformerFactory.newInstance();
  Transformer transformer = factory.newTransformer(new
  StreamSource(xslt));
  
  CaseForm caseForm = new CaseForm();
  caseForm.map(caseVO);
  
  // Setup input for XSLT transformation
  Source src = new SAXSource(new CaseXMLReader(),new
  CaseInputSource(caseForm));
  
  //System.out.println(input source:
  +((SAXSource)src).getInputSource().getByteStream().available());
  
  // Resulting SAX events (the generated FO) must be piped
  through
  to FOP
  Result res = new SAXResult(fop.getDefaultHandler());
  
  // Start XSLT transformation and FOP processing
  transformer.transform(src, res);
  }catch(Exception ex){
 System.out.println(Case2pdf - exception in export:  +
  ex.getMessage());
 ex.printStackTrace();
 throw new Exception(ex.getMessage());
  }
  finally {
  out.close();
  }
  
 }
  
  }
  
  .
  
  at runtime, I get a error from Apache FOP (The number of this PDFNumber
  must
  not be empty):
  
  -71066 [HttpRequestHandler-6502834] ERROR org.apache.fop.fo.FOTreeBuilder 
  -
  java.lang.IllegalArgumentException: The numbe
  -Case2pdf - exception in export: java.lang.IllegalArgumentException: The
  number of this PDFNumber must not be empty
  

Re: Problem generating PDF with FOP 0.20.5 and Latin Modern fonts

2007-11-14 Thread Daniel Rosenberg
Good!

Modifying the flags worked fine.

Thanks / Daniel


On Tue, 2007-11-13 at 16:21 +0100, Jeremias Maerki wrote:
 This should now be fixed in FOP Trunk.
 
 On FOP 0.20.5 you can try setting flags34/flags in the XML metric
 file. Use flags98flags for the italic variants.
 
 Jeremias Maerki
 
 
 
 On 08.11.2007 20:24:54 Daniel Rosenberg wrote:
  Hi,
  
  I'm trying to use the Latin Modern Type 1 fonts (v1.010) to generate a
  PDF file with FOP 0.20.5. Generating font metrics with PFMReader works
  fine (I guess), and the fonts get embedded into the PDF document. But,
  every time the PDF document is opened in Adobe Reader (v7.0.8 on
  Gentoo Linux) I get a warning saying The font 'LMSans10-Bold'
  contains bad /Flags. Any ideas of what the problem is?
  
  Thanks,
  
  Daniel
 
 
 -
 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: Capturing FOP logging message event in an embedded application using FOP 0.94

2007-11-14 Thread Michael Tracey Zellmann
Thanks for the response.

I am trying to think of a way to still succeed.

What I want to do is to send all logging messages from anything related to
FOP to their own file.

In the logging.properties, I tried:
org.apache.fop.FileHandler = java.util.logging.FileHandler
org.apache.fop.FileHandler.pattern = logs/docgen.log
org.apache.fop.FileHandler.limit = 5000
org.apache.fop.FileHandler.formatter = java.util.logging.SimpleFormatter

but that does not work.

I can say
java.util.logging.FileHandler.pattern = logs/docgenAll.log
and that will send all logging messages from any source to the file
docgenALL -
hwoever, I don't want all the messages - only ones froma class in the fop
hierarchy.

What should I do to accomplish this ?



On Nov 13, 2007 3:04 PM, Andreas L Delmelle [EMAIL PROTECTED] wrote:

 On Nov 13, 2007, at 18:29, Michael Tracey Zellmann wrote:

 Hi

  I have developed an application that generates PDFs of
  documentation in an eclipse environment controlled by a variety of
  SWT widgets.
 
  My customer would like his users to know when FOP has encountered a
  problem, but give them a simple message. We are already trapping
  exceptions, so I am interested in the kinds of events where FOP may
  generate a WARNING or SEVERE logging message. Like - the text has
  exceeded the allowed width and is overwriting another area, or the
  bookmark ids are pointing to a null view-port, for instance. I know
  how to write a File Handler to route those message to a file. Is
  there a way I can capture an event that will tell us to pop a
  dialog to the user, and hopefully get part of the logging message ?

 I fear you have stumbled upon a well-known shortcoming of FOP 0.9x:
 the error-reporting is not really what it should be. We all know it,
 but haven't found the time so far to take steps towards implementing
 something better, so exceptions and log messages are all there is to
 catch FTM... :(


 Sorry

 Andreas

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




RE: How to keep pagenumber over several page-sequences

2007-11-14 Thread Michael Niemann
That makes sense. By removing the initial pagenumber for the chapter block the 
count starts with the index page though. How can I make it start with 1 without 
setting it in the block?

Puppala, Kumar (LNG-CON) [EMAIL PROTECTED] wrote:v\:* 
{behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* 
{behavior:url(#default#VML);} .shape {behavior:url(#default#VML);}   
Having just the force-page-count property on the subsequent page sequences 
should do the trick.
   
  fo:page-sequence master-reference=ContentPageMaster 
force-page-count=no-force
   
  The page number on subsequent page sequences is a continuation from the 
previous page sequence in this case.
   
  
-
  



   
-
Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how.

Re: The number of this PDFNumber must not be empty

2007-11-14 Thread altmax

hi,
the FO file is as follows:

?xml version=1.0 encoding=UTF-8?
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
fo:layout-master-set
fo:simple-page-master margin-right=2cm margin-left=2cm
margin-bottom=2cm margin-top=2cm page-width=21cm page-height=29.7cm
master-name=simpleA4
fo:region-body/
/fo:simple-page-master
/fo:layout-master-set
fo:page-sequence master-reference=simpleA4
fo:flow flow-name=xsl-region-body
fo:block space-after=5mm font-weight=bold font-size=16ptTipologia:
Comunicazione di disservizio/fo:block
fo:block space-after=5mm font-size=12ptStato: Restituita a Wind per
accettazione/fo:block
fo:block font-size=10pt
numero: 548/2007/fo:block
/fo:flow
/fo:page-sequence
/fo:root



Jeremias Maerki-2 wrote:
 
 Yes, it's possible to use FOP inside Oracle, but if you run into
 certain problems (the one at hand is not normally one of them) you may
 need to replace the XML support bundled with Oracle with Apache
 Xerces/Xalan in order to avoid possible bugs in Oracle code. Please see
 the mailing list archives for further information. My reaction is simply
 triggered by your stating that you're running inside Oracle. But it
 would really help to know if the same problem appears outside Oracle,
 just to know on which side we have to look. Basic error finding strategy.
 
 The FO (XSL-FO) file in your case is just virtual (actually a SAX
 event stream). You get it by converting the XML file using the XSLT
 stylesheet you have. You can also do:
 
 fop -xml myfile.xml -xsl mystylesheet.xsl -pdf out.pdf
 
 ...on the command-line. But you know about that, don't you?
 
 To get the FO file:
 fop -xml myfile.xml -xsl mystylesheet.xsl -foout out.fo
 (and you'd post the out.fo file here)
 
 Jeremias Maerki
 
 
 

-- 
View this message in context: 
http://www.nabble.com/The-number-of-this-PDFNumber-must-not-be-empty-tf4803765.html#a13746939
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: How to keep pagenumber over several page-sequences

2007-11-14 Thread Puppala, Kumar (LNG-CON)
Let me try to understand your requirement. You have the following
page-sequences in your document

 

Page sequence for Index

Page sequence for Chapter1

Page sequence for Chapter2

...

 

And you want the page number to start off from 1 on Chapter 1 instead of
Index.

 

If this is what you want, you can set initial-page-number on the page
sequence for Chapter1 to 1 and then not mention this attribute on the
remaining page-sequences. Regarding page sequence for Index, you mention
the initial-page-number to 1 as well. The page number gets reset
whenever you mention the initial-page-number property on a particular
sequence.

 

Hope this helps.

 

 



From: Michael Niemann [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 14, 2007 4:09 AM
To: fop-users@xmlgraphics.apache.org
Subject: RE: How to keep pagenumber over several page-sequences

 

That makes sense. By removing the initial pagenumber for the chapter
block the count starts with the index page though. How can I make it
start with 1 without setting it in the block?

Puppala, Kumar (LNG-CON) [EMAIL PROTECTED] wrote:

Having just the force-page-count property on the subsequent page
sequences should do the trick.

 

fo:page-sequence master-reference=ContentPageMaster
force-page-count=no-force

 

The page number on subsequent page sequences is a continuation from the
previous page sequence in this case.

 



  



Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See
how. http://us.rd.yahoo.com/evt=51732/*http:/overview.mail.yahoo.com/ 



Re: The number of this PDFNumber must not be empty

2007-11-14 Thread Jeremias Maerki
Bull I just remembered that we've had this before:

http://fop-users.markmail.org/search/?q=PDFNumber+not+empty

Back then it was suggested that it could be a multi-threading problem
but looking at what the exception raises tells me it has nothing to do
with the (still unsolved) issue with DecimalFormat. That code is just
hanging around there. But then, without being able to reproduce the
problem here, I don't really know what to do. Maybe someone else has an
idea.

Jeremias Maerki



On 14.11.2007 10:40:28 altmax wrote:
 
 Hello,
 
 i have a problem with apache fop 0.94.
 
 My os is windows xp , my application server oracle 9ias oc4j1.0.2.2.1,
 jdk1.3.1_09 with jre 1.3.1_09.
 
 Class java is:
 .
 import
 ..
 
 public class Case2PDF {
 
 // configure fopFactory as desired
 private FopFactory fopFactory = FopFactory.newInstance();
  
 public void convertCase2PDF(CaseVO caseVO, File xslt, File pdf)
 throws Exception, IOException, FOPException,
 TransformerException {
 
 // Setup output
 OutputStream out = new java.io.FileOutputStream(pdf);
 out = new java.io.BufferedOutputStream(out);
 
 try {
 //Setup user agent
 FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
 PDFRenderer pdfrenderer = new PDFRenderer();
 pdfrenderer.setUserAgent(foUserAgent);
 foUserAgent.setRendererOverride(pdfrenderer);
 
 fopFactory.addElementMapping(new FOElementMapping());
 fopFactory.addElementMapping(new SVGElementMapping());
 fopFactory.addElementMapping(new
 BatikExtensionElementMapping());
 fopFactory.addElementMapping(new ExtensionElementMapping());
 fopFactory.addElementMapping(new XMPElementMapping());
 fopFactory.addElementMapping(new RDFElementMapping());
 fopFactory.addElementMapping(new PSExtensionElementMapping());
 
 // Construct fop with desired output format
 Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent,
 out);
 
 // Setup XSLT
 TransformerFactory factory = new
 org.apache.xalan.processor.TransformerFactoryImpl();//TransformerFactory.newInstance();
 Transformer transformer = factory.newTransformer(new
 StreamSource(xslt));
 
 CaseForm caseForm = new CaseForm();
 caseForm.map(caseVO);
 
 // Setup input for XSLT transformation
 Source src = new SAXSource(new CaseXMLReader(),new
 CaseInputSource(caseForm));
 
 //System.out.println(input source:
 +((SAXSource)src).getInputSource().getByteStream().available());
 
 // Resulting SAX events (the generated FO) must be piped through
 to FOP
 Result res = new SAXResult(fop.getDefaultHandler());
 
 // Start XSLT transformation and FOP processing
 transformer.transform(src, res);
 }catch(Exception ex){
System.out.println(Case2pdf - exception in export:  +
 ex.getMessage());
ex.printStackTrace();
throw new Exception(ex.getMessage());
 }
 finally {
 out.close();
 }
 
}
 
 }
 
 .
 
 at runtime, I get a error from Apache FOP (The number of this PDFNumber must
 not be empty):
 
 -71066 [HttpRequestHandler-6502834] ERROR org.apache.fop.fo.FOTreeBuilder  -
 java.lang.IllegalArgumentException: The numbe
 -Case2pdf - exception in export: java.lang.IllegalArgumentException: The
 number of this PDFNumber must not be empty
 javax.xml.transform.TransformerException:
 java.lang.IllegalArgumentException: The number of this PDFNumber must not be
 emp
 at
 org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1226)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:638)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)
 at com.bms.util.pdf.Case2PDF.convertCase2PDF(Case2PDF.java:93)
 at
 com.bms.presentation.action.assurance.ExportPDFAction.execute(ExportPDFAction.java:84)
 at
 org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
 at
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
 at
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 at
 org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at
 com.bms.presentation.servlet.BmsActionServlet.service(BmsActionServlet.java:222)
 at 

RE: How to keep pagenumber over several page-sequences

2007-11-14 Thread MichaelNie

thanks. chris already posted the solution to my noobish problem. the chapters
are generated through the same sequence template so I just had to insert the
initial value during the first iteration.


Puppala, Kumar (LNG-CON) wrote:
 
 Let me try to understand your requirement. You have the following
 page-sequences in your document
 
  
 
 Page sequence for Index
 
 Page sequence for Chapter1
 
 Page sequence for Chapter2
 
 ...
 
  
 
 And you want the page number to start off from 1 on Chapter 1 instead of
 Index.
 
  
 
 If this is what you want, you can set initial-page-number on the page
 sequence for Chapter1 to 1 and then not mention this attribute on the
 remaining page-sequences. Regarding page sequence for Index, you mention
 the initial-page-number to 1 as well. The page number gets reset
 whenever you mention the initial-page-number property on a particular
 sequence.
 
  
 
 Hope this helps.
 
  
 
  
 
 
 
 From: Michael Niemann [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, November 14, 2007 4:09 AM
 To: fop-users@xmlgraphics.apache.org
 Subject: RE: How to keep pagenumber over several page-sequences
 
  
 
 That makes sense. By removing the initial pagenumber for the chapter
 block the count starts with the index page though. How can I make it
 start with 1 without setting it in the block?
 
 Puppala, Kumar (LNG-CON) [EMAIL PROTECTED] wrote:
 
 Having just the force-page-count property on the subsequent page
 sequences should do the trick.
 
  
 
 fo:page-sequence master-reference=ContentPageMaster
 force-page-count=no-force
 
  
 
 The page number on subsequent page sequences is a continuation from the
 previous page sequence in this case.
 
  
 
 
 
   
 
 
 
 Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See
 how. http://us.rd.yahoo.com/evt=51732/*http:/overview.mail.yahoo.com/ 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-keep-pagenumber-over-several-page-sequences-tf4799039.html#a13748535
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: The number of this PDFNumber must not be empty

2007-11-14 Thread altmax

Already I read the previous mail, but i didn't solve my problem :(

So I do not hope to use Apache FOP with Oracle 9ias


Jeremias Maerki-2 wrote:
 
 Bull I just remembered that we've had this before:
 
 http://fop-users.markmail.org/search/?q=PDFNumber+not+empty
 
 Back then it was suggested that it could be a multi-threading problem
 but looking at what the exception raises tells me it has nothing to do
 with the (still unsolved) issue with DecimalFormat. That code is just
 hanging around there. But then, without being able to reproduce the
 problem here, I don't really know what to do. Maybe someone else has an
 idea.
 
 Jeremias Maerki
 
 
 
 On 14.11.2007 10:40:28 altmax wrote:
 
 Hello,
 
 i have a problem with apache fop 0.94.
 
 My os is windows xp , my application server oracle 9ias oc4j1.0.2.2.1,
 jdk1.3.1_09 with jre 1.3.1_09.
 
 Class java is:
 .
 import
 ..
 
 public class Case2PDF {
 
 // configure fopFactory as desired
 private FopFactory fopFactory = FopFactory.newInstance();
  
 public void convertCase2PDF(CaseVO caseVO, File xslt, File pdf)
 throws Exception, IOException, FOPException,
 TransformerException {
 
 // Setup output
 OutputStream out = new java.io.FileOutputStream(pdf);
 out = new java.io.BufferedOutputStream(out);
 
 try {
 //Setup user agent
 FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
 PDFRenderer pdfrenderer = new PDFRenderer();
 pdfrenderer.setUserAgent(foUserAgent);
 foUserAgent.setRendererOverride(pdfrenderer);
 
 fopFactory.addElementMapping(new FOElementMapping());
 fopFactory.addElementMapping(new SVGElementMapping());
 fopFactory.addElementMapping(new
 BatikExtensionElementMapping());
 fopFactory.addElementMapping(new ExtensionElementMapping());
 fopFactory.addElementMapping(new XMPElementMapping());
 fopFactory.addElementMapping(new RDFElementMapping());
 fopFactory.addElementMapping(new
 PSExtensionElementMapping());
 
 // Construct fop with desired output format
 Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,
 foUserAgent,
 out);
 
 // Setup XSLT
 TransformerFactory factory = new
 org.apache.xalan.processor.TransformerFactoryImpl();//TransformerFactory.newInstance();
 Transformer transformer = factory.newTransformer(new
 StreamSource(xslt));
 
 CaseForm caseForm = new CaseForm();
 caseForm.map(caseVO);
 
 // Setup input for XSLT transformation
 Source src = new SAXSource(new CaseXMLReader(),new
 CaseInputSource(caseForm));
 
 //System.out.println(input source:
 +((SAXSource)src).getInputSource().getByteStream().available());
 
 // Resulting SAX events (the generated FO) must be piped
 through
 to FOP
 Result res = new SAXResult(fop.getDefaultHandler());
 
 // Start XSLT transformation and FOP processing
 transformer.transform(src, res);
 }catch(Exception ex){
System.out.println(Case2pdf - exception in export:  +
 ex.getMessage());
ex.printStackTrace();
throw new Exception(ex.getMessage());
 }
 finally {
 out.close();
 }
 
}
 
 }
 
 .
 
 at runtime, I get a error from Apache FOP (The number of this PDFNumber
 must
 not be empty):
 
 -71066 [HttpRequestHandler-6502834] ERROR org.apache.fop.fo.FOTreeBuilder 
 -
 java.lang.IllegalArgumentException: The numbe
 -Case2pdf - exception in export: java.lang.IllegalArgumentException: The
 number of this PDFNumber must not be empty
 javax.xml.transform.TransformerException:
 java.lang.IllegalArgumentException: The number of this PDFNumber must not
 be
 emp
 at
 org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1226)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:638)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)
 at com.bms.util.pdf.Case2PDF.convertCase2PDF(Case2PDF.java:93)
 at
 com.bms.presentation.action.assurance.ExportPDFAction.execute(ExportPDFAction.java:84)
 at
 org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
 at
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
 at
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 at
 org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
 at 

BreakingAlgorithm Problem

2007-11-14 Thread fma-001

Hi!

I use FOP 0.93 and write some data in a table with several columns. In one
column data can be broader than the column-width without any chance to
hyphenate.

FOP then logs message: WARN  [BreakingAlgorithm] Line 1 of a paragraph
overflows the available area.

I tried to get rid of it with overflow- and wrap-option-attributes, but it
doesn'nt work:
fo:table-cell
fo:block-container overflow=scroll wrap-option=wrap
fo:block language=de hyphenate=true()
xsl:value-of select=./
/fo:block
/fo:block-container
/fo:table-cell

Say, I have a string www.verylonguri.com, FOP can't hyphenate it and does
write it into the next column. I would like to break it hard, like this:
www.verlon
guri.com

Is there any way to archive this?

Thank you in advance!
Franz
-- 
View this message in context: 
http://www.nabble.com/BreakingAlgorithm-Problem-tf4806438.html#a13751025
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: BreakingAlgorithm Problem

2007-11-14 Thread Puppala, Kumar (LNG-CON)
You could insert a Unicode Zero Width Space (#x200B;) after each
character within your table-cell. That should enable the word to break
properly without overflowing into the next cell.

However, if the same logic is applied to some standard text (which can
hyphenate) it will no longer hyphenate. 

Thanks,
Kumar

-Original Message-
From: fma-001 [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 14, 2007 11:46 AM
To: fop-users@xmlgraphics.apache.org
Subject: BreakingAlgorithm Problem


Hi!

I use FOP 0.93 and write some data in a table with several columns. In
one
column data can be broader than the column-width without any chance to
hyphenate.

FOP then logs message: WARN  [BreakingAlgorithm] Line 1 of a paragraph
overflows the available area.

I tried to get rid of it with overflow- and wrap-option-attributes, but
it
doesn'nt work:
fo:table-cell
fo:block-container overflow=scroll wrap-option=wrap
fo:block language=de hyphenate=true()
xsl:value-of select=./
/fo:block
/fo:block-container
/fo:table-cell

Say, I have a string www.verylonguri.com, FOP can't hyphenate it and
does
write it into the next column. I would like to break it hard, like this:
www.verlon
guri.com

Is there any way to archive this?

Thank you in advance!
Franz
-- 
View this message in context:
http://www.nabble.com/BreakingAlgorithm-Problem-tf4806438.html#a13751025
Sent from the FOP - Users mailing list archive at Nabble.com.


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



Attribute Extension

2007-11-14 Thread mckacl

In the current version of FOP, is there a mechanism to handle custom
attributes?

Thanks
-- 
View this message in context: 
http://www.nabble.com/Attribute-Extension-tf4808374.html#a13757702
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: Attribute Extension

2007-11-14 Thread Jeremias Maerki
Yes. If it's enough to handle your case, I don't know. What's your
requirement?

Jeremias Maerki



On 14.11.2007 23:16:44 mckacl wrote:
 
 In the current version of FOP, is there a mechanism to handle custom
 attributes?
 
 Thanks
 -- 
 View this message in context: 
 http://www.nabble.com/Attribute-Extension-tf4808374.html#a13757702
 Sent from the FOP - Users mailing list archive at Nabble.com.


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