Re: Arabic Font in FOP

2011-06-03 Thread Peter Hancock
Hi,

You are going to have to checkout the branch

http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ComplexScripts/
using subversion: info here http://xmlgraphics.apache.org/fop/download.html

Once you have the codebase you have to build it: info here
http://xmlgraphics.apache.org/fop/trunk/compiling.html

Good luck!

Pete



On Fri, Jun 3, 2011 at 6:12 AM, suri16kk suri1...@yahoo.com wrote:

 Hi Pete,

 Thanks for your reply.
 I am not sure how to get the fop version info. Please assist.

 I am using the Intersystems ZEN reporting engine to convert then xml to
 fo.
 I have attached the files for your reference.

 http://old.nabble.com/file/p31762930/pdfOutput.JPG pdfOutput.JPG
 http://old.nabble.com/file/p31762930/fop%2Bmessages.txt fop+messages.txt
 http://old.nabble.com/file/p31762930/xslfo.xml xslfo.xml
 http://old.nabble.com/file/p31762930/toxslfo.xml toxslfo.xml
 http://old.nabble.com/file/p31762930/tohtml.xml tohtml.xml
 --
 View this message in context: 
 http://old.nabble.com/Arabic-Font-in-FOP-tp31759175p31762930.html
 Sent from the FOP - Users mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



RE: Problems since upgrading,

2011-06-03 Thread Theresa Jayne Forster
The problem is that the Designers specify it must be HEAVY not BOLD and they
have no understanding of the numeric weights.

 

The designers use light, normal, bold, heavy and black 

 

The current FOP only supports normal and bold. 

 

I guess I will need to make sure that the fop I use is modded to support the
black and heavy as well as light.

 

 

Kindest regards

 


Theresa Forster

Senior Software Developer



From: Eric Douglas [mailto:edoug...@blockhouse.com] 
Sent: 02 June 2011 16:03
To: fop-users@xmlgraphics.apache.org
Subject: RE: Problems since upgrading,

 

heavy is not a standard keyword.

If you select the wrong value for the fonts you have loaded it should log a
warning for font replacement.

Keywords translate to specific numbers.

You would want to use the numbers instead of the words to be sure it's
always correct.

They might think light is 200 but your light font has a weight of 100, or
normal 300 / 400 etc.

http://www.w3.org/TR/CSS2/fonts.html#font-boldness

Standard keywords are normal (400) and bold (700), and lighter / bolder
(relative to parent).

 

 

 

  _  

From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] 
Sent: Thursday, June 02, 2011 10:46 AM
To: fop-users@xmlgraphics.apache.org
Subject: Problems since upgrading,

Since upgrading the fop I use from 0.23 to 1.0 I am now getting problems 

One of which is that the font designations I used to use are now no longer
possible, and was wondering why this has seemingly changed, and is there
plans to support the method I am used to using?

 

Before fo:block font-family=Frutiger font-style=normal
font-weight=heavy/

 

Now apparently I need to do weight as a number 700=bold etc

 

Kindest regards

 


Theresa Forster

Senior Software Developer



 

  _  

No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11



FOP with embedded font running in Oracle 10g

2011-06-03 Thread Flipz-007
Dear all,

I need to create Java application which will generate PDF report from given 
data. This application needs to be run in Oracle DB 10g environment as a stored 
procedure.

The main problem is that I don't know how to configure FOP to use my specific 
font which is embedded in application jar as a resource. In Internet there are 
many examples how to configure FOP if the font is located on filesystem, but in 
my case I need to load the font into DB inside my java archive.

I searched through the Internet but I didn't find any solution.
Could you give me any advice please?
Thank you very much.

Jiri

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: FOP with embedded font running in Oracle 10g

2011-06-03 Thread Michael Rubin
One thought that comes to mind off the cuff: Since a jar file is a zip 
file, and java can extract files from a zip, could your java class 
extract the font to a temporary location on the file system, then update 
your xconf file to point to the font, then run FOP using the xconf file, 
and then afterwards remove the font from its temporary location to tidy up?


Thanks.

-Mike

On 03/06/11 10:03, Flipz-007 wrote:

Dear all,

I need to create Java application which will generate PDF report from given 
data. This application needs to be run in Oracle DB 10g environment as a stored 
procedure.

The main problem is that I don't know how to configure FOP to use my specific 
font which is embedded in application jar as a resource. In Internet there are 
many examples how to configure FOP if the font is located on filesystem, but in 
my case I need to load the font into DB inside my java archive.

I searched through the Internet but I didn't find any solution.
Could you give me any advice please?
Thank you very much.

Jiri

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org







Michael Rubin
Developer

T: +44 20 8238 7400
F: +44 20 8238 7401

mru...@thunderhead.com

The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us 
immediately and then destroy it. 






-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Problems since upgrading,

2011-06-03 Thread Michael Rubin

If you are generating your fo file via a transform, maybe you could add to it 
to convert light, heavy and black to appropriate numeric values? Then the fo 
file would contain all legal values while maintaining the source's values as 
required by the designers and avoids making changes to FOP to support non 
standard font weight names.

Or perhaps it might be nice to add capability to add to the xconf file a section to 
describe a font weight 'name' and a translation to a suitable numeric value. From my 
recent playing with code that reads in the xconf file this shouldn't be too 
difficult. e.g. font-weight-template name='heavy' weight='800'/ - not sure 
where in the xconf this should go without looking in more detail. (If this option is 
the one then I guess it would be nice to create a patch so that it can be considered 
for the trunk for others to use.)

Thanks.

-Mike

On 03/06/11 11:10, Theresa Jayne Forster wrote:
The problem is that the Designers specify it must be HEAVY not BOLD and they 
have no understanding of the numeric weights.

The designers use light, normal, bold, heavy and black

The current FOP only supports normal and bold.

I guess I will need to make sure that the fop I use is modded to support the 
black and heavy as well as light.


Kindest regards


Theresa Forster
Senior Software Developer

From: Eric Douglas [mailto:edoug...@blockhouse.com]
Sent: 02 June 2011 16:03
To: fop-users@xmlgraphics.apache.orgmailto:fop-users@xmlgraphics.apache.org
Subject: RE: Problems since upgrading,

heavy is not a standard keyword.
If you select the wrong value for the fonts you have loaded it should log a 
warning for font replacement.
Keywords translate to specific numbers.
You would want to use the numbers instead of the words to be sure it's always 
correct.
They might think light is 200 but your light font has a weight of 100, or 
normal 300 / 400 etc.
http://www.w3.org/TR/CSS2/fonts.html#font-boldness
Standard keywords are normal (400) and bold (700), and lighter / bolder 
(relative to parent).




From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk]
Sent: Thursday, June 02, 2011 10:46 AM
To: fop-users@xmlgraphics.apache.orgmailto:fop-users@xmlgraphics.apache.org
Subject: Problems since upgrading,
Since upgrading the fop I use from 0.23 to 1.0 I am now getting problems
One of which is that the font designations I used to use are now no longer 
possible, and was wondering why this has seemingly changed, and is there plans 
to support the method I am used to using?

Before fo:block font-family=”Frutiger” font-style=”normal” 
font-weight=”heavy”/

Now apparently I need to do weight as a number 700=bold etc

Kindest regards


Theresa Forster
Senior Software Developer




No virus found in this message.
Checked by AVG - www.avg.comhttp://www.avg.com
Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11




Michael Rubin


Developer


[http://thunderhead.com/email_signature/images/Thunderhead-logo.png]
[http://thunderhead.com/email_signature/images/make-every-communication-count.png]
  [http://thunderhead.com/email_signature/images/triangles.png]

T

F

M

E

W


+44 20 8238 7400

+44 20 8238 7401



mru...@thunderhead.commailto:mru...@thunderhead.com

www.thunderhead.comhttp://www.thunderhead.com



Thunderhead recognized in the Red Herring 2011 Top 100 Europe.  Click 
herehttp://www.herring100.com/RHE/2011/top100.html to read more.


[http://thunderhead.com/email_signature/images/linkedin.png]http://www.linkedin.com/companies/25033/Thunderhead
 [http://thunderhead.com/email_signature/images/twitter.png] http://twitter.com/Thunderheadon 
[http://thunderhead.com/email_signature/images/rss.png] http://www.thunderhead.com/rss/rss.php 
[http://thunderhead.com/email_signature/images/youtube.png] http://www.youtube.com/user/ThunderheadOn 
[http://thunderhead.com/email_signature/images/theblog.png] http://thunderheadinnovate.wordpress.com/  
[http://thunderhead.com/email_signature/images/werehiring.png] http://thunderhead.com/about/careers.php

The contents of this e-mail are intended for the named addressee only. It 
contains information that may be confidential. Unless you are the named 
addressee or an authorized designee, you may not copy or use it, or disclose it 
to anyone else. If you received it in error please notify us immediately and 
then destroy it.






RE: FOP with embedded font running in Oracle 10g

2011-06-03 Thread Theresa Jayne Forster
Are you just saying your Java App has to be able to access the font to
create the PDF based on data from the database or are you saying you have to
store the ttf file inside the database?

The former, just use auto-detect/ in the fopconfig.  With 1.0 it searches
the classpath (which includes your application Jar) to find fonts, and you
can also have external jar files containing the Fonts as well.

Auto-Detect and auto-embed feature
When the auto-detect flag is set in the configuration, FOP will
automatically search for fonts in the default paths for your operating
system.
FOP will also auto-detect fonts which are available in the classpath, if
they are described as application/x-font in the MANIFEST.MF file. For
example, if your .jar file contains font/myfont.ttf:
Manifest-Version: 1.0
  Name: font/myfont.ttf
  Content-Type: application/x-font

This feature allows you to create JAR files containing fonts. The JAR files
can be added to fop by providing them in the classpath, e.g. copying them
into the lib/ directory.

Kindest regards


Theresa Forster
Senior Software Developer

-Original Message-
From: Flipz-007 [mailto:flipz-...@seznam.cz] 
Sent: 03 June 2011 10:04
To: fop-users@xmlgraphics.apache.org
Subject: FOP with embedded font running in Oracle 10g

Dear all,

I need to create Java application which will generate PDF report from given
data. This application needs to be run in Oracle DB 10g environment as a
stored procedure.

The main problem is that I don't know how to configure FOP to use my
specific font which is embedded in application jar as a resource. In
Internet there are many examples how to configure FOP if the font is located
on filesystem, but in my case I need to load the font into DB inside my java
archive.

I searched through the Internet but I didn't find any solution.
Could you give me any advice please?
Thank you very much.

Jiri

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org

-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11
Internal Virus Database is out of date.



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: FOP with embedded font running in Oracle 10g

2011-06-03 Thread Michael Rubin
Ooh didn't know about that. Shows I'm still very new to FOP and learning 
all the while... This sounds much better than my idea to 
programmatically extract the font to a temporary location which may be 
disregarded...


Thanks.

-Mike

On 03/06/11 11:33, Theresa Jayne Forster wrote:

Are you just saying your Java App has to be able to access the font to
create the PDF based on data from the database or are you saying you have to
store the ttf file inside the database?

The former, just useauto-detect/  in the fopconfig.  With 1.0 it searches
the classpath (which includes your application Jar) to find fonts, and you
can also have external jar files containing the Fonts as well.

Auto-Detect and auto-embed feature
When the auto-detect flag is set in the configuration, FOP will
automatically search for fonts in the default paths for your operating
system.
FOP will also auto-detect fonts which are available in the classpath, if
they are described as application/x-font in the MANIFEST.MF file. For
example, if your .jar file contains font/myfont.ttf:
Manifest-Version: 1.0
   Name: font/myfont.ttf
   Content-Type: application/x-font

This feature allows you to create JAR files containing fonts. The JAR files
can be added to fop by providing them in the classpath, e.g. copying them
into the lib/ directory.

Kindest regards


Theresa Forster
Senior Software Developer






Michael Rubin
Developer

T: +44 20 8238 7400
F: +44 20 8238 7401

mru...@thunderhead.com

The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us 
immediately and then destroy it. 





-Original Message-

From: Flipz-007 [mailto:flipz-...@seznam.cz]
Sent: 03 June 2011 10:04
To: fop-users@xmlgraphics.apache.org
Subject: FOP with embedded font running in Oracle 10g

Dear all,

I need to create Java application which will generate PDF report from given
data. This application needs to be run in Oracle DB 10g environment as a
stored procedure.

The main problem is that I don't know how to configure FOP to use my
specific font which is embedded in application jar as a resource. In
Internet there are many examples how to configure FOP if the font is located
on filesystem, but in my case I need to load the font into DB inside my java
archive.

I searched through the Internet but I didn't find any solution.
Could you give me any advice please?
Thank you very much.

Jiri

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org

-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11
Internal Virus Database is out of date.



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org




-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Arabic Font in FOP

2011-06-03 Thread Glenn Adams
I would recommend using the following because it is the most up to date
version of the Complex Scripts work (the SVN version that Peter references
below is somewhat behind in terms of bug fixes, etc):

http://github.com/skynavga/fop

See branch i18n.arabic. Also see documentation at
http://skynav.trac.cvsdude.com/fop/wiki/ComplexScripts, particularly the
supported fonts list.

Regards,
Glenn

On Fri, Jun 3, 2011 at 1:52 AM, Peter Hancock peter.hanc...@gmail.comwrote:

 Hi,

 You are going to have to checkout the branch

 http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ComplexScripts/
 using subversion: info here
 http://xmlgraphics.apache.org/fop/download.html

 Once you have the codebase you have to build it: info here
 http://xmlgraphics.apache.org/fop/trunk/compiling.html

 Good luck!

 Pete

 

 On Fri, Jun 3, 2011 at 6:12 AM, suri16kk suri1...@yahoo.com wrote:
 
  Hi Pete,
 
  Thanks for your reply.
  I am not sure how to get the fop version info. Please assist.
 
  I am using the Intersystems ZEN reporting engine to convert then xml to
  fo.
  I have attached the files for your reference.
 
  http://old.nabble.com/file/p31762930/pdfOutput.JPG pdfOutput.JPG
  http://old.nabble.com/file/p31762930/fop%2Bmessages.txt fop+messages.txt
  http://old.nabble.com/file/p31762930/xslfo.xml xslfo.xml
  http://old.nabble.com/file/p31762930/toxslfo.xml toxslfo.xml
  http://old.nabble.com/file/p31762930/tohtml.xml tohtml.xml
  --
  View this message in context:
 http://old.nabble.com/Arabic-Font-in-FOP-tp31759175p31762930.html
  Sent from the FOP - Users mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
  For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
 
 

 -
 To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org




RE: Problems since upgrading,

2011-06-03 Thread Theresa Jayne Forster
On that note, is it possible to chain XSL files on the fop input, or even make 
it double process, 

Ie multi pass processing to allow for calculations on page number etc?

 

 

Kindest regards

 


Theresa Forster

Senior Software Developer





Re: Problems since upgrading,

2011-06-03 Thread Glenn Adams
keep in mind that you do not have to use FOP to perform the XSL to FO
transformation; you can use other tools outside of FOP to perform the
transformation, and then feed the resultant XSL-FO file to FOP;

On Fri, Jun 3, 2011 at 7:04 AM, Theresa Jayne Forster ther...@inbrand.co.uk
 wrote:

 On that note, is it possible to chain XSL files on the fop input, or even
 make it double process,

 Ie multi pass processing to allow for calculations on page number etc?





 Kindest regards




 Theresa Forster

 Senior Software Developer




RE: Problems since upgrading,

2011-06-03 Thread Eric Douglas
I'm not sure what you're trying to do here but XSL is not used by FOP.
For convenience, FOP can accept FO input or XML and XSL input but it
only uses the FO.
I'm using embedded code to transform XML with an XSL, and for debugging
I wanted to see the FO, so I split out the FOP and call the transform
twice.
 
I'm not sure what you mean by calculations on page number.
If you're letting FOP overrun blocks to show one thing on multiple pages
you can get the page count after the transform, and you can call the
transform again if you retain your input.
 
If you can do what I do and just know what fits on a page, you can call
the transform once for each page.  I started doing that to save memory
and I can generate really large reports.  I just have to pass a value in
with each input to use the xsl:initial-page-number so the first page of
the second document can come out identified as page 2.  I retain the
PDFs in memory, no physical files have to be written, and I create PDF
objects with them using the pdfbox project which is able to create a new
PDF and copy in the pages.  I tested this on a report with over 1800
pages.  Trying to get FOP to put that all in one document crashed out of
memory long before that.
 



From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] 
Sent: Friday, June 03, 2011 9:04 AM
To: fop-users@xmlgraphics.apache.org
Subject: RE: Problems since upgrading,



On that note, is it possible to chain XSL files on the fop input, or
even make it double process, 

Ie multi pass processing to allow for calculations on page number etc?

 

 

Kindest regards

 


Theresa Forster

Senior Software Developer





Re: FOP EMPTY PDF

2011-06-03 Thread Oscar.Flores

Hi there Rob yeah it actually work Thanks the only thing that left its
the images that has the have the pdf but it great jejeje, do you know what
can i do about that??  

Rob Sargent-4 wrote:
 
 Not at all certain if this is your problem, but what about changing
  Source src = new StreamSource(args[4]); //I think you have opened 
 two streams on args[4]
 to
  Source src = new JDOMSource(jdomDocument); //Are you making 
 multiple files in that for loop?
 
 
 On 06/02/2011 04:43 PM, Oscar.Flores wrote:
 Hi thanks for the quick answer Rob i do some testing with the program
 EditiX
 to see if the stylesheet transform the xml to the pdf that i want and it
 does so i dont now if it is my code that is bad or something i post the
 code
 can you see it please later i will put the fo file


 public final class Main {
  public static void main(String[] args) throws Exception {
  try {

  File file = new File(args[0]);
  Comprobante comp = CFDv2.newComprobante(new
 FileInputStream(file));
  CFDv2 cfd = new CFDv2(comp);
  PrivateKey key = KeyLoader.loadPKCS8PrivateKey(new
 FileInputStream(args[1]),(args[2]));
  X509Certificate cert = KeyLoader.loadX509Certificate(new
 FileInputStream(args[3]));
  Comprobante sellado = cfd.sellarComprobante(key, cert);
  String cadena = cfd.getCadenaOriginal();
  String sello = sellado.getSello();
  //System.out.println(sello);
  //System.out.println(cadena);

  //OutputStream archivo = new
 FileOutputStream(C:/F0008556FA.xml);
  //cfd.validar();
  //cfd.verificar();
  //cfd.guardar();

  // Creamos el builder basado en SAX
  SAXBuilder builder = new SAXBuilder();
  // Construimos el arbol DOM a partir del fichero xml
  Document documentJDOM = builder.build(new
 FileInputStream(args[0]));


  Element raiz = documentJDOM.getRootElement();//toma el nodo
 raiz
 del documento.
  raiz.setAttribute(sello, sello);
  raiz.setAttribute(certificado, sellado.getCertificado());
  //System.out.println(raiz.getAttributeValue(sello));
  //System.out.println(raiz.getAttributeValue(certificado));
  // Recorremos los hijos de la etiqueta raíz
  ListElement  hijosRaiz = raiz.getChildren();
  boolean Bandera=false;
  for(Element hijo: hijosRaiz)
  {
  // Obtenemos el nombre y su contenido de tipo texto
  String nombre = hijo.getName();

  if (nombre.equals(Addenda))
  {   ListElement  subHijo = hijo.getChildren();
  for(Element hij: subHijo)
  {
  hij.setAttribute(CadenaOriginal, cadena);
  //System.out.println(CadenaOriginal:
 +hij.getAttributeValue(CadenaOriginal));
  Bandera=true;
  break;
  }
  }
  if (Bandera)
  {
  XMLOutputter out = new
 XMLOutputter(Format.getPrettyFormat());
  File nuevoXML = new File(args[0]);
  try{
  FileOutputStream archivoXML= new
 FileOutputStream
 (nuevoXML);
  out.output(documentJDOM, archivoXML);

 }
  catch (Exception
 ex){System.out.println(ex.getMessage());}
  // Para generar el pdf a partir de un archivo.xsl y
 un
  // archivo.xml
  }
}
FopFactory fopFactory = FopFactory.newInstance();
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
   File pdffile = new File(args[5]);

   OutputStream out = new java.io.FileOutputStream(pdffile);
   out = new java.io.BufferedOutputStream(out);
   try {
   Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,
 foUserAgent, out);
  TransformerFactory factory =
 TransformerFactory.newInstance();
  Transformer transformer = factory.newTransformer(new
 StreamSource(args[4]));
  transformer.setParameter(versionParam, 2.0);
  Source src = new StreamSource(args[4]);
  Result res = new SAXResult(fop.getDefaultHandler());
  System.setProperty(java.awt.headless, true);
  transformer.transform(src, res);
  } finally {
   out.close();
  }
System.out.println(Success!);
   } catch (Exception e) {
e.printStackTrace(System.err);
System.exit(-1);
 }
   }
}



 Rob Sargent-4 wrote:
 Oscar,

 I think it might be more 

Hair ripping time

2011-06-03 Thread Theresa Jayne Forster
Ok I cannot see what is wrong here, 

A test app does this 

 

Fop fop =
fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);

TransformerFactory factory = TransformerFactory.newInstance();

Source xslt = new StreamSource(new File(C:/sample.xsl));

Transformer transformer = factory.newTransformer(xslt);

 

And works fine, 

The app I am working on does this

 

Fop fop =
fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);

TransformerFactory factory = TransformerFactory.newInstance();

Transformer transformer = factory.newTransformer(new
StreamSource(inputFO));

 

And it immediately jumps out when it hits the newTransformer() line..

In the first it's an xslt, in the second it's a FO file, do I have to do
something different for that?

 

WTF aren't these the same, and why does so much of FOP jump out without even
trying to give debug output? Or is there a way of doing that?

 

 

Kindest regards

 


Theresa Forster

Senior Software Developer



 



Re: Hair ripping time

2011-06-03 Thread John Burgess
The xslt is used to transform from your source format to the FO format used by FOP.  If you already 
have a formatting object file, you can pass it to fop immediately without transformation.


xsl can be a bit tricky to get started on, some like O'reilly's Java and XSLT book is probably a 
good place to start.


FOP itself seems to produce reasonable messages.

--
John Burgess
Risk Decisions Limited
Whichford House
Parkway Court
Oxford Business Park South
OX4 2JY

T: 01865 718666
F: 01865 718600
M: 07984 863890
E: john.burg...@riskdecisions.com
W: http://www.riskdecisions.com



On 03/06/2011 15:30, Theresa Jayne Forster wrote:


Ok I cannot see what is wrong here,

A test app does this

Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);

TransformerFactory factory = TransformerFactory.newInstance();

Source xslt = new StreamSource(new File(C:/sample.xsl));

Transformer transformer = factory.newTransformer(xslt);

And works fine,

The app I am working on does this

Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);

TransformerFactory factory = TransformerFactory.newInstance();

Transformer transformer = factory.newTransformer(new 
StreamSource(inputFO));

And it immediately jumps out when it hits the newTransformer() line

In the first it's an xslt, in the second it's a FO file, do I have to do 
something different for that?

WTF aren't these the same, and why does so much of FOP jump out without even trying to give debug 
output? Or is there a way of doing that?


Kindest regards


Theresa Forster

Senior Software Developer



Re: Hair ripping time

2011-06-03 Thread Andreas L. Delmelle
On 03 Jun 2011, at 16:30, Theresa Jayne Forster wrote:

Hi Theresa

 Ok I cannot see what is wrong here,`
snip /
 The app I am working on does this
  
 Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);
 TransformerFactory factory = TransformerFactory.newInstance();
 Transformer transformer = factory.newTransformer(new 
 StreamSource(inputFO));
  
 And it immediately jumps out when it hits the newTransformer() line….

... because a FO file is not a valid stylesheet. 

Seems like you need:

Transformer transformer = factory.newTransformer();
transformer.transform(new StreamSource(inputFO));


HTH!

Regards

Andreas
---
-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



RE: Hair ripping time

2011-06-03 Thread Theresa Jayne Forster
Tried that same result, it jumps immediately out of the try catch into the
finally

Kindest regards


Theresa Forster
Senior Software Developer

Seems like you need:

Transformer transformer = factory.newTransformer();
transformer.transform(new StreamSource(inputFO));


HTH!

Regards

Andreas
---
-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org

-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11
Internal Virus Database is out of date.



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



RE: Hair ripping time

2011-06-03 Thread Eric Douglas
1. You can and should reuse the TransformerFactory.
2. FO is not a stylesheet.  The FO is the input to the transform, where
you were putting the XML not the XSL.  Leave out the XSL part on the FO
one.
 



From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] 
Sent: Friday, June 03, 2011 10:30 AM
To: fop-users@xmlgraphics.apache.org
Subject: Hair ripping time



Ok I cannot see what is wrong here, 

A test app does this 

 

Fop fop =
fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);

TransformerFactory factory =
TransformerFactory.newInstance();

Source xslt = new StreamSource(new File(C:/sample.xsl));

Transformer transformer = factory.newTransformer(xslt);

 

And works fine, 

The app I am working on does this

 

Fop fop =
fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);

TransformerFactory factory =
TransformerFactory.newInstance();

Transformer transformer = factory.newTransformer(new
StreamSource(inputFO));

 

And it immediately jumps out when it hits the newTransformer() line

In the first it's an xslt, in the second it's a FO file, do I have to do
something different for that?

 

WTF aren't these the same, and why does so much of FOP jump out without
even trying to give debug output? Or is there a way of doing that?

 

 

Kindest regards

 


Theresa Forster

Senior Software Developer



 



RE: FOP with embedded font running in Oracle 10g

2011-06-03 Thread Eric Douglas
If you're using embedded code doing your own transform with all custom fonts 
you can use FOP's FontLoader classes to manually load your own fonts into the 
renderer.  It's a bit more complicated but it should run faster than trying to 
find the font on the path.


-Original Message-
From: Michael Rubin [mailto:mru...@thunderhead.com] 
Sent: Friday, June 03, 2011 6:38 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: FOP with embedded font running in Oracle 10g

Ooh didn't know about that. Shows I'm still very new to FOP and learning all 
the while... This sounds much better than my idea to programmatically extract 
the font to a temporary location which may be disregarded...

Thanks.

-Mike

On 03/06/11 11:33, Theresa Jayne Forster wrote:
 Are you just saying your Java App has to be able to access the font to 
 create the PDF based on data from the database or are you saying you 
 have to store the ttf file inside the database?

 The former, just useauto-detect/  in the fopconfig.  With 1.0 it 
 searches the classpath (which includes your application Jar) to find 
 fonts, and you can also have external jar files containing the Fonts as well.

 Auto-Detect and auto-embed feature
 When the auto-detect flag is set in the configuration, FOP will 
 automatically search for fonts in the default paths for your operating 
 system.
 FOP will also auto-detect fonts which are available in the classpath, 
 if they are described as application/x-font in the MANIFEST.MF file. 
 For example, if your .jar file contains font/myfont.ttf:
 Manifest-Version: 1.0
Name: font/myfont.ttf
Content-Type: application/x-font

 This feature allows you to create JAR files containing fonts. The JAR 
 files can be added to fop by providing them in the classpath, e.g. 
 copying them into the lib/ directory.

 Kindest regards


 Theresa Forster
 Senior Software Developer

 



Michael Rubin
Developer

T: +44 20 8238 7400
F: +44 20 8238 7401

mru...@thunderhead.com

The contents of this e-mail are intended for the named addressee only. It 
contains information that may be confidential. Unless you are the named 
addressee or an authorized designee, you may not copy or use it, or disclose it 
to anyone else. If you received it in error please notify us immediately and 
then destroy it. 




-Original Message-
 From: Flipz-007 [mailto:flipz-...@seznam.cz]
 Sent: 03 June 2011 10:04
 To: fop-users@xmlgraphics.apache.org
 Subject: FOP with embedded font running in Oracle 10g

 Dear all,

 I need to create Java application which will generate PDF report from given
 data. This application needs to be run in Oracle DB 10g environment as a
 stored procedure.

 The main problem is that I don't know how to configure FOP to use my
 specific font which is embedded in application jar as a resource. In
 Internet there are many examples how to configure FOP if the font is located
 on filesystem, but in my case I need to load the font into DB inside my java
 archive.

 I searched through the Internet but I didn't find any solution.
 Could you give me any advice please?
 Thank you very much.

 Jiri

 -
 To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org

 -
 No virus found in this message.
 Checked by AVG - www.avg.com
 Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11
 Internal Virus Database is out of date.



 -
 To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org


-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



RE: Hair ripping time

2011-06-03 Thread Theresa Jayne Forster
This makes no sense its crashing out with no error on this line
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);
And it jumps straight to 
  System.out.print(*);

The code I am using is as follows

public File generatePDFFromXml(File xslFile,File xmlFile) {
FopFactory fopFactory = FopFactory.newInstance();
BufferedOutputStream out = null;
File tempFile = null;
try {
fopFactory.setStrictValidation(false);
DefaultConfigurationBuilder cfgBuilder = new
DefaultConfigurationBuilder();
Configuration cfg = cfgBuilder.buildFromFile(new
File(fopconfig.xml));
fopFactory.setUserConfig(cfg);

tempFile = File.createTempFile(W2P, .pdf);
out = new BufferedOutputStream(new FileOutputStream(tempFile));
FOUserAgent useragent= fopFactory.newFOUserAgent();
useragent.setOutputFile(tempFile);
useragent.setTargetResolution(300);
Fop fop =
fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);
TransformerFactory factory = TransformerFactory.newInstance();
Source xslt = new StreamSource(xslFile);
Transformer transformer = factory.newTransformer(xslt);
Source src = new StreamSource(xmlFile);
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(src, res);
   out.flush();
   out.close();
System.out.println(Output File = +tempFile.getAbsolutePath());
}  catch (TransformerConfigurationException ex) {
ex.printStackTrace();
} catch (TransformerException ex) {
ex.printStackTrace();
} catch (FOPException ex) {
ex.printStackTrace();
} catch (FileNotFoundException ex) {
ex.printStackTrace();
   } catch (IOException ex) {
ex.printStackTrace();
} catch (Exception ex) {
ex.printStackTrace();
} finally {
try {
  System.out.print(*);
out.close();
   } catch (IOException ex) {
}
}
return tempFile;
}

Kindest regards


Theresa Forster
Senior Software Developer

ther...@inbrand.co.uk
www.inbrand.co.uk

Tel: 01483 266500



IMPORTANT NOTE: This transmission has been sent by or on behalf of In Brand
Software Ltd. The information in this transmission is for the intended
addressee only and is confidential to that intended addressee. If either you
know or you ought reasonably to conclude that you are not, or may not be,
the intended addressee, you are hereby given notice that any unauthorised
dissemination or copying of this transmission and any disclosure or use of
the information
transmitted is strictly prohibited and may be illegal. In such circumstances
we ask for your assistance in notifying us immediately by e-mail, telephone
or letter.

InBrand Software Ltd Registered in England No. 5131004 Registered Office:
The Old Barn, Ewhurst Road, Cranleigh GU6 7EF 


-Original Message-
From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] 
Sent: 03 June 2011 15:42
To: fop-users@xmlgraphics.apache.org
Subject: RE: Hair ripping time

Tried that same result, it jumps immediately out of the try catch into the
finally

Kindest regards


Theresa Forster
Senior Software Developer

Seems like you need:

Transformer transformer = factory.newTransformer();
transformer.transform(new StreamSource(inputFO));


HTH!

Regards

Andreas
---
-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org

-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11
Internal Virus Database is out of date.



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org

-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11
Internal Virus Database is out of date.



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Hair ripping time

2011-06-03 Thread Glenn Adams
XSLT != XSL-FO

Completely different languages.

G.

On Fri, Jun 3, 2011 at 8:30 AM, Theresa Jayne Forster ther...@inbrand.co.uk
 wrote:

 Ok I cannot see what is wrong here,

 A test app does this



 Fop fop =
 fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);

 TransformerFactory factory = TransformerFactory.newInstance();

 Source xslt = new StreamSource(new File(C:/sample.xsl));

 Transformer transformer = factory.newTransformer(xslt);



 And works fine,

 The app I am working on does this



 Fop fop =
 fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);

 TransformerFactory factory = TransformerFactory.newInstance();

 Transformer transformer = factory.newTransformer(new
 StreamSource(inputFO));



 And it immediately jumps out when it hits the newTransformer() line….

 In the first it’s an xslt, in the second it’s a FO file, do I have to do
 something different for that?



 WTF aren’t these the same, and why does so much of FOP jump out without
 even trying to give debug output? Or is there a way of doing that?





 Kindest regards




 Theresa Forster

 Senior Software Developer





RE: Hair ripping time

2011-06-03 Thread Theresa Jayne Forster
Sorry I think we have moved on from that – I was testing it in a slightly 
different way as the example method wasn’t working, 

 

The problem is when I do the newFop command its exiting from the system 
completely, the standalone app works fine with the same config etc.

 

The spring app under tomcat is doing the following in the logs

 

2011-06-03 16:54:44,292 [http-8080-2] INFO  uk.co.inbrand.inline.InLine - 
Processing Incoming Request..

2011-06-03 16:54:49,150 [http-8080-2] DEBUG 
org.apache.fop.apps.FopFactoryConfigurator - Initializing FopFactory 
Configurationwith strict validation

2011-06-03 16:54:49,151 [http-8080-2] DEBUG FOP - target-resolution set to: 
300.0dpi (px2mm=0.0846)

2011-06-03 16:54:49,151 [http-8080-2] DEBUG FOP - target-resolution set to: 
300.0dpi (px2mm=0.0846)

2011-06-03 16:54:49,152 [http-8080-2] DEBUG 
org.apache.fop.render.AbstractConfigurator - User configuration found for MIME 
type application/pdf

2011-06-03 16:54:49,152 [http-8080-2] DEBUG 
org.apache.fop.render.AbstractConfigurator - User configuration found for MIME 
type application/pdf

2011-06-03 16:54:49,152 [http-8080-2] DEBUG 
org.apache.fop.fonts.FontInfoConfigurator - Starting font configuration...

 

Kindest regards

 


Theresa Forster

Senior Software Developer





Re: FOP EMPTY PDF

2011-06-03 Thread Rob Sargent
Looking at your external-graphics calls, some of the sizes seem strange 
to me. 20pt is a rather small space for a logo? But if all the files 
names are correct, you might try using content-width=scale-to-fit.



On 06/03/2011 07:53 AM, Oscar.Flores wrote:

Hi there Rob yeah it actually work Thanks the only thing that left its
the images that has the have the pdf but it great jejeje, do you know what
can i do about that??

Rob Sargent-4 wrote:

Not at all certain if this is your problem, but what about changing
  Source src = new StreamSource(args[4]); //I think you have opened
two streams on args[4]
to
  Source src = new JDOMSource(jdomDocument); //Are you making
multiple files in that for loop?


On 06/02/2011 04:43 PM, Oscar.Flores wrote:

Hi thanks for the quick answer Rob i do some testing with the program
EditiX
to see if the stylesheet transform the xml to the pdf that i want and it
does so i dont now if it is my code that is bad or something i post the
code
can you see it please later i will put the fo file


public final class Main {
  public static void main(String[] args) throws Exception {
  try {

  File file = new File(args[0]);
  Comprobante comp = CFDv2.newComprobante(new
FileInputStream(file));
  CFDv2 cfd = new CFDv2(comp);
  PrivateKey key = KeyLoader.loadPKCS8PrivateKey(new
FileInputStream(args[1]),(args[2]));
  X509Certificate cert = KeyLoader.loadX509Certificate(new
FileInputStream(args[3]));
  Comprobante sellado = cfd.sellarComprobante(key, cert);
  String cadena = cfd.getCadenaOriginal();
  String sello = sellado.getSello();
  //System.out.println(sello);
  //System.out.println(cadena);

  //OutputStream archivo = new
FileOutputStream(C:/F0008556FA.xml);
  //cfd.validar();
  //cfd.verificar();
  //cfd.guardar();

  // Creamos el builder basado en SAX
  SAXBuilder builder = new SAXBuilder();
  // Construimos el arbol DOM a partir del fichero xml
  Document documentJDOM = builder.build(new
FileInputStream(args[0]));


  Element raiz = documentJDOM.getRootElement();//toma el nodo
raiz
del documento.
  raiz.setAttribute(sello, sello);
  raiz.setAttribute(certificado, sellado.getCertificado());
  //System.out.println(raiz.getAttributeValue(sello));
  //System.out.println(raiz.getAttributeValue(certificado));
  // Recorremos los hijos de la etiqueta raíz
  ListElement   hijosRaiz = raiz.getChildren();
  boolean Bandera=false;
  for(Element hijo: hijosRaiz)
  {
  // Obtenemos el nombre y su contenido de tipo texto
  String nombre = hijo.getName();

  if (nombre.equals(Addenda))
  {   ListElement   subHijo = hijo.getChildren();
  for(Element hij: subHijo)
  {
  hij.setAttribute(CadenaOriginal, cadena);
  //System.out.println(CadenaOriginal:
+hij.getAttributeValue(CadenaOriginal));
  Bandera=true;
  break;
  }
  }
  if (Bandera)
  {
  XMLOutputter out = new
XMLOutputter(Format.getPrettyFormat());
  File nuevoXML = new File(args[0]);
  try{
  FileOutputStream archivoXML= new
FileOutputStream
(nuevoXML);
  out.output(documentJDOM, archivoXML);

 }
  catch (Exception
ex){System.out.println(ex.getMessage());}
  // Para generar el pdf a partir de un archivo.xsl y
un
  // archivo.xml
  }
}
FopFactory fopFactory = FopFactory.newInstance();
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
   File pdffile = new File(args[5]);

   OutputStream out = new java.io.FileOutputStream(pdffile);
   out = new java.io.BufferedOutputStream(out);
   try {
   Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,
foUserAgent, out);
  TransformerFactory factory =
TransformerFactory.newInstance();
  Transformer transformer = factory.newTransformer(new
StreamSource(args[4]));
  transformer.setParameter(versionParam, 2.0);
  Source src = new StreamSource(args[4]);
  Result res = new SAXResult(fop.getDefaultHandler());
  System.setProperty(java.awt.headless, true);
  transformer.transform(src, res);
  } finally {
   out.close();
  }

Re: Problems with FOP and image

2011-06-03 Thread Oscar.Flores

aaa hey thanks for the help the other day, i resolve the problem changing the
version of FOP for the 0.95beta instead of the 1.0, it works now it prints
the image and its good, thanks and we are in touch if anything else fails
jejeje   

Rob Sargent-4 wrote:
 
 Nothing in the log from the transformer?
 
 On 06/03/2011 09:47 AM, Oscar.Flores wrote:
 hi there i have another problem i hope you can help me the pdf that i
 create
 with foe has no image, it dont show any of them, the xsl seems to be
 rigth i
 tested with EditX and the pdf show me the image, what can it be, i have
 xmlgraphics-commons-1.5svn, fop 1.0, fop-pdf-images 2.0.1 Snapshot for
 the
 render of the image but it don work please help!!!  :,(
 
 -
 To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Problems-with-FOP-and-image-tp31766430p31767057.html
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Hair ripping time

2011-06-03 Thread Rob Sargent

That print statement will always be called since it's in the finally block.

On 06/03/2011 09:27 AM, Theresa Jayne Forster wrote:

This makes no sense its crashing out with no error on this line
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);
And it jumps straight to
   System.out.print(*);

The code I am using is as follows

public File generatePDFFromXml(File xslFile,File xmlFile) {
 FopFactory fopFactory = FopFactory.newInstance();
 BufferedOutputStream out = null;
 File tempFile = null;
 try {
 fopFactory.setStrictValidation(false);
 DefaultConfigurationBuilder cfgBuilder = new
DefaultConfigurationBuilder();
 Configuration cfg = cfgBuilder.buildFromFile(new
File(fopconfig.xml));
 fopFactory.setUserConfig(cfg);

 tempFile = File.createTempFile(W2P, .pdf);
 out = new BufferedOutputStream(new FileOutputStream(tempFile));
 FOUserAgent useragent= fopFactory.newFOUserAgent();
 useragent.setOutputFile(tempFile);
 useragent.setTargetResolution(300);
 Fop fop =
fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);
 TransformerFactory factory = TransformerFactory.newInstance();
 Source xslt = new StreamSource(xslFile);
 Transformer transformer = factory.newTransformer(xslt);
 Source src = new StreamSource(xmlFile);
 Result res = new SAXResult(fop.getDefaultHandler());
 transformer.transform(src, res);
out.flush();
out.close();
 System.out.println(Output File = +tempFile.getAbsolutePath());
 }  catch (TransformerConfigurationException ex) {
 ex.printStackTrace();
 } catch (TransformerException ex) {
 ex.printStackTrace();
 } catch (FOPException ex) {
 ex.printStackTrace();
 } catch (FileNotFoundException ex) {
 ex.printStackTrace();
} catch (IOException ex) {
 ex.printStackTrace();
 } catch (Exception ex) {
 ex.printStackTrace();
 } finally {
 try {
   System.out.print(*);
 out.close();
} catch (IOException ex) {
 }
 }
 return tempFile;
 }

Kindest regards


Theresa Forster
Senior Software Developer

ther...@inbrand.co.uk
www.inbrand.co.uk

Tel: 01483 266500



IMPORTANT NOTE: This transmission has been sent by or on behalf of In Brand
Software Ltd. The information in this transmission is for the intended
addressee only and is confidential to that intended addressee. If either you
know or you ought reasonably to conclude that you are not, or may not be,
the intended addressee, you are hereby given notice that any unauthorised
dissemination or copying of this transmission and any disclosure or use of
the information
transmitted is strictly prohibited and may be illegal. In such circumstances
we ask for your assistance in notifying us immediately by e-mail, telephone
or letter.

InBrand Software Ltd Registered in England No. 5131004 Registered Office:
The Old Barn, Ewhurst Road, Cranleigh GU6 7EF


-Original Message-
From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk]
Sent: 03 June 2011 15:42
To: fop-users@xmlgraphics.apache.org
Subject: RE: Hair ripping time

Tried that same result, it jumps immediately out of the try catch into the
finally

Kindest regards


Theresa Forster
Senior Software Developer

Seems like you need:

Transformer transformer = factory.newTransformer();
transformer.transform(new StreamSource(inputFO));


HTH!

Regards

Andreas
---
-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org

-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11
Internal Virus Database is out of date.



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org

-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11
Internal Virus Database is out of date.



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Hair ripping time

2011-06-03 Thread Andreas L. Delmelle
On 03 Jun 2011, at 17:27, Theresa Jayne Forster wrote:

Hi Theresa

 This makes no sense its crashing out with no error on this line
 Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);
 And it jumps straight to 
  System.out.print(*);
snip /
}  catch (TransformerConfigurationException ex) {
ex.printStackTrace();
} catch (TransformerException ex) {
ex.printStackTrace();
} catch (FOPException ex) {
ex.printStackTrace();
} catch (FileNotFoundException ex) {
ex.printStackTrace();
   } catch (IOException ex) {
ex.printStackTrace();
} catch (Exception ex) {
ex.printStackTrace();

Not as a general practice, but if all else fails:

} catch (Throwable t) {
t.printStackTrace();
}

Hopefully, that will reveal what is happening here.


Regards

Andreas
---

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: fop called in xslt extension is not finding fonts

2011-06-03 Thread Rob Sargent
Never mind.  My first cut at putting the interface into the getMethod 
call was broken.  Obviously reflection requires the interface 
explicitly, not the implementation.




On 06/03/2011 11:17 AM, Rob Sargent wrote:

I'm having trouble with XMLRender.mimicRenderer(Render) using fop-1.0

Unfortunately I have to do this all via reflection:  Here's the broken 
part:


Method getRendererFactory =
userAgent.getClass().getMethod(getRendererFactory, null);
Object rendererFactory = getRendererFactory.invoke(userAgent, null);
Method createRenderer =
rendererFactory.getClass().getMethod(createRenderer,
 
userAgent.getClass(),
 
String.class);

Object targetRenderer = createRenderer.invoke(rendererFactory,
userAgent, AbstractFop9xStage.FOP_MIMETYPE_DEFAULT);

//Now the special renderer for the intermediate file (AreaText style)
Class xmlRendererClass =
getFopClassLoader().loadClass(org.apache.fop.render.xml.XMLRenderer);
Constructor xmlRendererConstructor =
xmlRendererClass.getConstructor(null);
Object xmlRenderer = xmlRendererConstructor.newInstance(null);
Method mimicMethod = xmlRendererClass.getMethod(mimicRenderer,
targetRenderer.getClass());
mimicMethod.invoke(xmlRenderer, targetRenderer);

//Make sure special renderer is used
Method setRendererMethod =
userAgent.getClass().getMethod(setRendererOverride,
xmlRenderer.getClass());
setRendererMethod.invoke(userAgent, xmlRenderer);

The error is:

java.lang.NoSuchMethodException:

org.apache.fop.render.xml.XMLRenderer.mimicRenderer(org.apache.fop.render.intermediate.IFRenderer)

I'm not sure why I'm getting the IFRenderer, but I've checked that 
that class is an implementation of Renderer so I don't understand the 
error. If I don't enter the broken block the pdf is generated 
correctly. (I only want to enter the broken block when I'm trying to 
use the same fop to spit out a portion of the document: a table of 
which I need to find the on-page size.)


On 06/02/2011 03:46 PM, Rob Sargent wrote:
Naturally I should have been more clear in my original posting: I'm 
using the AreaTree (application/X-fop-areatree) intermediate format 
not the IF form (application/X-fop-intermediate-format). the AT form 
gives me an easy answer to content length.  I've also re-read the doc 
on AT and have some hope of resolving the problem.  We'll see.


On 06/02/2011 09:57 AM, Rob Sargent wrote:

Chris,

Thanks.  This looks like what I need. Now I have to work it into my 
switch-hitting fop runner!


Cheers,

rjs


On 06/02/2011 09:35 AM, Chris Bowditch wrote:

On 02/06/2011 08:47, mehdi houshmand wrote:

Hi Rob,


Hi Rob,

Mehdi is right that the problem when generating IF is down to the 
way the fop.xconf is organized by Renderer. The command line option 
he mentions is the way to resolve this from the command line. The 
API code we use to set the Mimic Renderer (the renderer from which 
to lookup configuration for the IF Renderer in the fop.xconf) is 
shown below:


IFDocumentHandler targetHandler = 
m_factory.getRendererFactory().createDocumentHandler(m_foUserAgent, 
mimeType);


IFSerializer ifSerializer = new IFSerializer();
ifSerializer.setContext(new IFContext(m_foUserAgent));
ifSerializer.mimicDocumentHandler(targetHandler);

HTH,

Chris


I just tested this on my system and I was finding the same results as
you... When I set the output format to IF, FOP wasn't working. So
anyway, I fixed it by setting the output MIME type, which is done via
the command line as such:

./fop -c fop.xconf test.fo -ifinsert mime-type  output.if

so in my case it was:

./fop -c fop.xconf test.fo -if application/pdf output.if

When you think about it, it does make sense. You refer to fonts in 
the

fop.xconf as a child of their rendering output, which allows you to
distinguish different font files according to the document output
format. There wouldn't be any way of FOP knowing your desired FINAL
output format if you were processing to IF.

How you do that using FOPs API, I don't know, but I can't imagine 
that

would be hard to find out.

Mehdi

On 1 June 2011 19:18, Rob Sargentrsarg...@xmission.com  wrote:
Again with thanks to Jeremias, I'm successfully sizing the 
region-before for
dynamically generated tables. I'm doing this via and xslt 
extension function

(Xalan style).

The xslt extension calls my sizing function which employs fop-1.0 to
generate an IF from the given dom.Node.  I notice that during the 
function's
invocation of fop-1.0 that the named fonts are not found and are 
substituted
with any in the resultant intermediate format output, with 
font-size=1000
(), with log messages like  'Font Optima-Oblique,normal,700 
not found.
Substituting with any,normal,700'.  I'm doubly confused because