RE: PDF Transcoder bringing the server down

2005-01-21 Thread Saptarshi Sen
Hi,
I tried to check for a graphical environment before the 'transcode'
process using the piece of code Victor had provided (attached below). There
is infact a graphical environment available (the method returns true).

The statement ge =
GraphicsEnvironment.getLocalGraphicsEnvironment(); generates the following
log:
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]
Font specified in font.properties not found [-urw-itc
zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific]

However, there was no LinkageError at this step.

At the next step (transcode call), the server just comes down. The
log I see is:
Assertion failed: errno == 0  count == (size_t) size, file
../../../src/share/native/sun/awt/font/fontmanager/fontobjects/fontObject.cpp
, line 343
Abort - core dumped

What could be the problem?

Will using the PJA (Pure Java AWT) package help?

Thanks,
Saptarshi.

-Original Message-
From: Victor Mote [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 20, 2005 10:02 PM
To: [EMAIL PROTECTED]
Subject: RE: PDF Transcoder bringing the server down


Saptarshi Sen wrote:

   I am trying to convert an SVG into PDF using the PDF 
 Transcoder in FOP. There are external fonts embedded into the 
 PDF. FOP has been embedded into our application which runs on 
 Weblogic. The entire process works fine on my local machine 
 which runs Win 2k.
 
   However, when I try the same on our integration machine 
 running Solaris, the call to the 'transcode' process just 
 brings down my Weblogic server. There is no exception thrown. 
 The PDF generated is of size 0 KB.
 
   I have no clue as to what is causing this problem. What 
 are the various details I need to take care of while running 
 FOP on Solaris?

Based on your description, the likely cause is that Batik can't find a local
graphical environment in which to run on the Solaris box. If Solaris has a
GUI, try running it under that (I am more familiar with Linux which has a
graphical console that can be used for such things). Also, here is some code
that can be used to check *before* running a task requiring a graphical
environment:

/**
 * Determines whether this environment can support graphical functions
that
 * are required for system fonts, Batik (SVG processing), and other
 * AWT-dependent systems. The result returned here is somewhat different
 * from that returned by [EMAIL PROTECTED]
java.awt.GraphicsEnvironment#isHeadless

PDF Transcoder bringing the server down

2005-01-20 Thread Saptarshi Sen
Hi,
I am trying to convert an SVG into PDF using the PDF Transcoder in
FOP. There are external fonts embedded into the PDF. FOP has been embedded
into our application which runs on Weblogic. The entire process works fine on
my local machine which runs Win 2k.

However, when I try the same on our integration machine running
Solaris, the call to the 'transcode' process just brings down my Weblogic
server. There is no exception thrown. The PDF generated is of size 0 KB.

I have no clue as to what is causing this problem. What are the
various details I need to take care of while running FOP on Solaris?

Thanks,
Saptarshi.
-
Disclaimer
-

This message(including attachment if any)is confidential and may be 
privileged.Before opening attachments please check them
for viruses and defects.MindTree Consulting Private Limited (MindTree)will not 
be responsible for any viruses or defects or
any forwarded attachments emanating either from within MindTree or outside.If 
you have received this message by mistake please notify the sender by return  
e-mail and delete this message from your system. Any unauthorized use or 
dissemination of this message in whole or in part is strictly prohibited.  
Please note that e-mails are susceptible to change and MindTree shall not be 
liable for any improper, untimely or incomplete transmission.

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

FW: Handling multiple spaces

2004-12-24 Thread Saptarshi Sen
Hi,
I got the problem regarding the NoClassDefFoundErrors. The new jars
weren't mentioned in my Manifest file. I was able to generate PDF's from my
application using the PDF transcoder. However, they do not have the fonts
embedded and hence are quite large.

I had a few questions regarding font embedding. 
1. Can I use the same font metrics files(xml) with Batik that I used
for FOP?
2. The SVG that I generate (using Corda PopChart) has fonts embedded
within it. Say, I was using TradeGothic CondEighteen, it appears in my SVG
as:

!ENTITY s2 font-family:'CF TradeGothic
CondEighteen';font-size:7;fill:#00;pointer-events:none;  (Note the 'CF
' prepended to the font name).

The font definition is like:
defs
font horiz-adv-x=1168
font-face font-family=CF TradeGothic
CondEighteen units-per-em=1024 panose-1=0 0 4 0 0 0 0 0 0 0 ascent=950
descent=-216/
..
/font
/defs
(Again, the font is named as 'CF TradeGothic CondEighteen').

Am I correct in saying that the 'CF ' part is supposed to be internal
to the SVG file and not to be used outside it? The font in the metrics file
is called 'TradeGothic CondEighteen' (which is what it should be).

Now, if I were to use the PDFTranscoder to convert the SVG to PDF, do
I need to replace all the 'CF TradeGothic CondEighteen' with 'TradeGothic
CondEighteen'? Also, while converting from SVG to PDF, are the font
definitions defsfont ./font/defs taken into consideration? I
mean, does PDFTranscoder use the font definition? (When I was using FOP to do
this conversion, I used to form the FO file from the SVG file. In that, I
used to keep only the SVG part and strip the definitions. I also used to
replace the 'CF TradeGothic CondEighteen' with 'TradeGothic CondEighteen'. Do
I need to the same/similar thing here?)

I am attaching a typical SVG file that is generated by PopChart.

Regards,
Saptarshi.

 pieUnicodeSVG.svg 



  -Original Message-
 From: Saptarshi Sen  
 Sent: Thursday, December 23, 2004 10:00 PM
 To:   '[EMAIL PROTECTED]'
 Subject:  RE: Handling multiple spaces
 
 This is getting increasingly away from FOP and closer to
 Batik.nevertheless, I am continuing along this thread to get some more
 inputs.
 
 I have added all the jar's under batik's lib folder into my project as well
 as my Weblogic domain (where other libraries are placed).
 
 However, when I try to run the application I get a
 java.lang.NoClassDefFoundError:
 org/apache/batik/transcoder/TranscoderException. Is there anything that I
 am missing. (I found a similar query by another person who was using
 Tomcat. The reply simply asked him to include the jars under the web
 container's lib directory).
 
 
 In my case, I have all the jar's already in my Weblogic's application
 folder.
 
 Thanks,
 Saptarshi.
 
 -Original Message-
 From: Jeremias Maerki [mailto:[EMAIL PROTECTED]
 Sent: Thursday, December 23, 2004 7:37 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Handling multiple spaces
 
 
 Uh, now it gets complicated
 
 On 23.12.2004 14:32:56 Saptarshi Sen wrote:
  Hi,
  I got the desired output using Batik. I am now trying to integrate it
  into my application.
  
  Since Batik uses the PDFTranscoder class from FOP, what are the
  various jar's that I need to include in my project path. I understand
 that I
  should remove the fop.jar (from version 0.20.5) from my project path.
 Which
  are the jar's from batik 1.5.1 that I need to include.
 
 I think you need all JARs from the lib directory of the binary
 distribution except batik-svggen.jar and batik-swing.jar. Not sure. I'd
 have to do a trial-and-error. pdf-transcoder.jar contains all classes
 needed by FOP's PDF Transcoder.
 
  A few requirements in my application is that I'll be embedding custom
  fonts and using batik just for SVG to PDF conversion.
 
 Now for the tricky part. Font configuration for the new transcoder is
 not documented, yet, and it's a bit different than in FOP 0.20.5 and may
 even change again until the first release of the redesign code.
 
 Here's a snippet to create an Avalon Configuration Object with the font
 configuration:
 
 import org.apache.avalon.framework.configuration.Configuration;
 import
 org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
 import org.apache.avalon.framework.container.ContainerUtil;
 
 import org.apache.batik.transcoder.Transcoder;
 import org.apache.batik.transcoder.TranscoderException;
 import org.apache.batik.transcoder.TranscoderInput;
 import org.apache.batik.transcoder.TranscoderOutput;
 import org.apache.batik.transcoder.XMLAbstractTranscoder;
 import org.apache.batik.transcoder.image.ImageTranscoder;
 
 [..]
 
 //Transcoder instantiation
 Transcoder transcoder = transcoder = new

RE: Handling multiple spaces

2004-12-24 Thread Saptarshi Sen
Hi,
I am just not able to embed fonts into my PDF images while using
PDFTranscoder. As a result, the PDF's are quite large.

I created a config file with the font declarations and used the
Config builder to configure the transcoder. But it does not embed the fonts.
I could be doing something wrong; but I don't know what. I tried to remove
the fonts tag in the config file; but even that did not help.

What is interesting is that when I tried to convert my SVG (with
embedded fonts) into a PDF using the batik-rasterizer.jar utility, it
actually gave me a PDF with embedded fonts. In this case, I hadn't even
provided any font information. What is the reason for this?

Also, if this *phenomenon* can be banked on, can I try and use the
batik-rasterizer utility from within my application?

Is there any semi-stable release of FOP since 0.20.5 where the
xml:space attribute is respected and which is ready for use in
applications. It need not have all features that are there in the current
version - I just want that attribute to be respected. If such a release does
not exist, is there any code snippet that recognizes the xml:space
attribute which I can plug into the 0.20.5 code and rebuild the fop.jar file?

Wish you a Merry Christmas.

Thanks,
Saptarshi.

-Original Message-
From: Jeremias Maerki [mailto:[EMAIL PROTECTED]
Sent: Friday, December 24, 2004 12:54 PM
To: [EMAIL PROTECTED]
Subject: Re: Handling multiple spaces



On 24.12.2004 06:36:14 Saptarshi Sen wrote:
 Hi,
   I got the problem regarding the NoClassDefFoundErrors. The new jars
 weren't mentioned in my Manifest file.

Now that I look at this a second time I realize that you mean that
you've solved the problem. D'Oh.

 I was able to generate PDF's from my
 application using the PDF transcoder. However, they do not have the fonts
 embedded and hence are quite large.
 
   I had a few questions regarding font embedding. 
   1. Can I use the same font metrics files(xml) with Batik that I used
 for FOP?

Yes, I think so. If there are any problems just recreate the font
metrics using the PFMReader and TTFReader from FOP's CVS HEAD. But there
shouldn't really be any differences.

   2. The SVG that I generate (using Corda PopChart) has fonts embedded
 within it. Say, I was using TradeGothic CondEighteen, it appears in my SVG
 as:
 
   !ENTITY s2 font-family:'CF TradeGothic
 CondEighteen';font-size:7;fill:#00;pointer-events:none;  (Note the
'CF
 ' prepended to the font name).
 
   The font definition is like:
   defs
   font horiz-adv-x=1168
   font-face font-family=CF TradeGothic
 CondEighteen units-per-em=1024 panose-1=0 0 4 0 0 0 0 0 0 0
ascent=950
 descent=-216/
   ..
   /font
   /defs
   (Again, the font is named as 'CF TradeGothic CondEighteen').
 
   Am I correct in saying that the 'CF ' part is supposed to be internal
 to the SVG file and not to be used outside it? The font in the metrics file
 is called 'TradeGothic CondEighteen' (which is what it should be).

I've seen that there are sometimes multiple names for a single font
which can lead to a certain amount of confusion.

   Now, if I were to use the PDFTranscoder to convert the SVG to PDF, do
 I need to replace all the 'CF TradeGothic CondEighteen' with 'TradeGothic
 CondEighteen'? 

I've seen behaviour like this before but until today haven't
investigated, yet. Simply use the same names in your font configuration
XML so the font gets detected. You can define aliases (i.e.
font-triplets) there.

 Also, while converting from SVG to PDF, are the font
 definitions defsfont ./font/defs taken into consideration?
I
 mean, does PDFTranscoder use the font definition? (When I was using FOP to
do
 this conversion, I used to form the FO file from the SVG file. In that, I
 used to keep only the SVG part and strip the definitions. I also used to
 replace the 'CF TradeGothic CondEighteen' with 'TradeGothic CondEighteen'.
Do
 I need to the same/similar thing here?)

FOP's :-) PDFTranscoder cannot use these embedded SVG fonts. They are
handled by Batik. There's a todo item where these embedded fonts should
be converted to Type3 fonts but that's not implemented, yet. I suggest
you do the same stripping you've done for FOP.

   I am attaching a typical SVG file that is generated by PopChart.


Jeremias Maerki


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

-
Disclaimer
-

This message(including attachment

RE: Handling multiple spaces

2004-12-23 Thread Saptarshi Sen
Hi,
I tried to download the latest Code from
http://cvs.apache.org/snapshots/xml-fop/xml-fop_20041223052817.tar.gz and
then did a build on it. While converting the fo file into a PDF, I get the
error:

Exception in thread main java.lang.OutOfMemoryError
no stack trace available

Attaching the fo file. What could be the possible reason?

Thanks,
Saptarshi.

P.S. I performed the build using the build.bat file from FOP 0.20.5; The
build was successful. Could this have anything to do with this error?


-Original Message-
From: Jeremias Maerki [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 23, 2004 3:36 PM
To: [EMAIL PROTECTED]
Subject: Re: Handling multiple spaces


Please, always follow up on the fop-users mailing list so other people
can profit, too.

The right URL is actually this one:
http://cvs.apache.org/viewcvs.cgi/xml-fop/src/java/org/apache/fop/svg/PDFTran
scoder.java

You need to download the HEAD tag (i.e. without any additional
parameters) from CVS as documented here:
http://xml.apache.org/fop/dev/index.html
http://xml.apache.org/cvs.html

Alternatively, CVS snapshots are here:
http://cvs.apache.org/snapshots/xml-fop/

Note to fop-devs: We don't seem to have a link to
http://xml.apache.org/fop/download.html in the menu structure anymore.

On 23.12.2004 10:38:10 Saptarshi Sen wrote:
 Hi,
   I was trying to get the PDFTranscoder from the head version (as you
 had mentioned). Was checking the logs at the following location:

http://cvs.apache.org/viewcvs.cgi/xml-fop/src/org/apache/fop/svg/PDFTranscode
 r.java?hideattic=0rev=1.25view=log. Can you tell me which one will have
the
 required fix; for respecting the xml:preserve attribute.
 
 Thanks,
 Saptarshi.
 
 -Original Message-
 From: Jeremias Maerki [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 22, 2004 7:07 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Handling multiple spaces
 
 
 Seems to be a bug in the SVG part in FOP 0.20.5. The attribute is
 respected in the new SVG transcoder (in FOP CVS HEAD), however. If you
 only need to convert the SVG into PDF (without any real need for XSL-FO),
 you can try the PDF Transcoder for Batik. Try the one shipped with the
 latest Batik release or if this still doesn't help, download the FOP
 source code from CVS (or using a CVS snapshot) to build the PDF
 Transcoder yourself.
 
 On 22.12.2004 10:47:51 Saptarshi Sen wrote:
  The xml:space=preserve attribute does not seem to have any effect on
the
  PDF generated. The SVG image is within a fo:instream-foreign-object tag.
I
  could not find any attribute that will preserve white spaces.
  
  I am attaching a typical fo file that we generate.
  
  Thanks,
  Saptarshi.
  
   pieUnicodeSVG.fo 
  
-Original Message-
   From: Saptarshi Sen  
   Sent: Wednesday, December 22, 2004 12:54 PM
   To:   FOP Mailing List (E-mail)
   Subject:  Handling multiple spaces
   
   Hi,
 We are using FOP to convert SVG images into PDF. The SVG images are
   generated using a tool called PopChart.
   
 When we view the SVG image, multiple spaces are collapsed into a
   single space. This can be offset using the xml:space=preserve
attribute
   in the text tags. Is there any other method by which we can preserve
   multiple spaces.
   
 Since I do not have any control over the SVG image produced by
   PopChart, can I set any parameters during the FOP call? Alternatively,
I
   could include the  xml:space=preserve attribute in my text tags, but
 this
   would be very messy. Is there an easier approach?
   
   Thanks,
   Saptarshi.



Jeremias Maerki


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



pieUnicodeSVG.fo
Description: pieUnicodeSVG.fo
-
Disclaimer
-

This message(including attachment if any)is confidential and may be 
privileged.Before opening attachments please check them
for viruses and defects.MindTree Consulting Private Limited (MindTree)will not 
be responsible for any viruses or defects or
any forwarded attachments emanating either from within MindTree or outside.If 
you have received this message by mistake please notify the sender by return  
e-mail and delete this message from your system. Any unauthorized use or 
dissemination of this message in whole or in part is strictly prohibited.  
Please note that e-mails are susceptible to change and MindTree shall not be 
liable for any improper, untimely or incomplete transmission.

-
-
To unsubscribe

RE: Handling multiple spaces

2004-12-23 Thread Saptarshi Sen
Hi,
I got the desired output using Batik. I am now trying to integrate it
into my application.

Since Batik uses the PDFTranscoder class from FOP, what are the
various jar's that I need to include in my project path. I understand that I
should remove the fop.jar (from version 0.20.5) from my project path. Which
are the jar's from batik 1.5.1 that I need to include.

A few requirements in my application is that I'll be embedding custom
fonts and using batik just for SVG to PDF conversion.

Thanks.
Saptarshi.

-Original Message-
From: Jeremias Maerki [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 23, 2004 5:13 PM
To: [EMAIL PROTECTED]
Subject: Re: Handling multiple spaces


Same here. That's why I said earlier, that you should use the PDF
Transcoder (not FOP itself) if you can live without XSL-FO, because if
you need XSL-FO (which I don't know) then you've got bad luck because
there's currently no work-around. The CVS HEAD code is our code
currently being redesigned and it will probably not work for any
real-life application at the moment.

I've just verified the following with success:
- Download Batik 1.5.1 (http://xml.apache.org/batik/)
- Extract the SVG from the FO file into a plain SVG file.
- On the command-line say: 
java -jar batik-rasterizer.jar -m application/pdf pieUnicode.svg

(This uses FOP's PDF Transcoder to convert SVG to PDF. No XSL-FO
involved.)

Produces a nice PDF with spaces respected. If you need to integrate that
in a Java application, then look at the Transcoder documentation here:
http://xml.apache.org/batik/rasterizerTutorial.html
http://cvs.apache.org/viewcvs.cgi/xml-fop/examples/embedding/java/embedding/E
xampleSVG2PDF.java?rev=HEAD

On 23.12.2004 12:07:50 Saptarshi Sen wrote:
 Hi,
   I tried to download the latest Code from
 http://cvs.apache.org/snapshots/xml-fop/xml-fop_20041223052817.tar.gz and
 then did a build on it. While converting the fo file into a PDF, I get the
 error:
 
 Exception in thread main java.lang.OutOfMemoryError
 no stack trace available
 
 Attaching the fo file. What could be the possible reason?
 
 Thanks,
 Saptarshi.
 
 P.S. I performed the build using the build.bat file from FOP 0.20.5; The
 build was successful. Could this have anything to do with this error?


Jeremias Maerki


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

-
Disclaimer
-

This message(including attachment if any)is confidential and may be 
privileged.Before opening attachments please check them
for viruses and defects.MindTree Consulting Private Limited (MindTree)will not 
be responsible for any viruses or defects or
any forwarded attachments emanating either from within MindTree or outside.If 
you have received this message by mistake please notify the sender by return  
e-mail and delete this message from your system. Any unauthorized use or 
dissemination of this message in whole or in part is strictly prohibited.  
Please note that e-mails are susceptible to change and MindTree shall not be 
liable for any improper, untimely or incomplete transmission.

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

RE: Handling multiple spaces

2004-12-23 Thread Saptarshi Sen
This is getting increasingly away from FOP and closer to
Batik.nevertheless, I am continuing along this thread to get some more
inputs.

I have added all the jar's under batik's lib folder into my project as well
as my Weblogic domain (where other libraries are placed).

However, when I try to run the application I get a
java.lang.NoClassDefFoundError:
org/apache/batik/transcoder/TranscoderException. Is there anything that I am
missing. (I found a similar query by another person who was using Tomcat. The
reply simply asked him to include the jars under the web container's lib
directory).


In my case, I have all the jar's already in my Weblogic's application folder.

Thanks,
Saptarshi.

-Original Message-
From: Jeremias Maerki [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 23, 2004 7:37 PM
To: [EMAIL PROTECTED]
Subject: Re: Handling multiple spaces


Uh, now it gets complicated

On 23.12.2004 14:32:56 Saptarshi Sen wrote:
 Hi,
   I got the desired output using Batik. I am now trying to integrate it
 into my application.
 
   Since Batik uses the PDFTranscoder class from FOP, what are the
 various jar's that I need to include in my project path. I understand that
I
 should remove the fop.jar (from version 0.20.5) from my project path. Which
 are the jar's from batik 1.5.1 that I need to include.

I think you need all JARs from the lib directory of the binary
distribution except batik-svggen.jar and batik-swing.jar. Not sure. I'd
have to do a trial-and-error. pdf-transcoder.jar contains all classes
needed by FOP's PDF Transcoder.

   A few requirements in my application is that I'll be embedding custom
 fonts and using batik just for SVG to PDF conversion.

Now for the tricky part. Font configuration for the new transcoder is
not documented, yet, and it's a bit different than in FOP 0.20.5 and may
even change again until the first release of the redesign code.

Here's a snippet to create an Avalon Configuration Object with the font
configuration:

import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
import org.apache.avalon.framework.container.ContainerUtil;

import org.apache.batik.transcoder.Transcoder;
import org.apache.batik.transcoder.TranscoderException;
import org.apache.batik.transcoder.TranscoderInput;
import org.apache.batik.transcoder.TranscoderOutput;
import org.apache.batik.transcoder.XMLAbstractTranscoder;
import org.apache.batik.transcoder.image.ImageTranscoder;

[..]

//Transcoder instantiation
Transcoder transcoder = transcoder = new org.apache.fop.svg.PDFTranscoder();

[..]

//Font configuration
DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
Configuration cfg = cfgBuilder.buildFromFile(new
File(src/xml/pdf-transcoder-cfg.xml));
ContainerUtil.configure(transcoder, cfg);

[..]

//Transcoder properties supported by the PDF Transcoder
int dpi = 300;
transcoder.addTranscodingHint(ImageTranscoder.KEY_PIXEL_UNIT_TO_MILLIMETER, 
new Float((float)(25.4 / dpi))); 
transcoder.addTranscodingHint(XMLAbstractTranscoder.KEY_XML_PARSER_VALIDATING
, Boolean.FALSE);
transcoder.addTranscodingHint(PDFTranscoder.KEY_STROKE_TEXT, Boolean.FALSE);

[..]

//On with the normal transcoding process as documented in Batik...



The XML file for the font configuration would look approximately like
this:

  cfg
fonts
  font metrics-url=file:C:/Dev/FOP/temp/fonts/FUTURAL.ttf.xml
kerning=no embed-url=file:C:/Dev/FOP/Temp/fonts/FUTURAL.ttf
font-triplet name=Futura style=normal weight=200/
font-triplet name=Futura style=normal weight=normal/
  /font
  font metrics-url=file:C:\Dev\FOP\temp\fonts\ARIAL.TTF.xml
kerning=no embed-url=file:C:/Dev/FOP/Temp/fonts/ARIAL.ttf
font-triplet name=Arial style=normal weight=normal/
  /font
  font metrics-url=file:C:\Dev\FOP\temp\fonts\ARIALBD.TTF.xml
kerning=no embed-url=file:C:/Dev/FOP/Temp/fonts/ARIALBD.ttf
font-triplet name=Arial style=normal weight=bold/
  /font
/fonts
  /cfg


There's one potential problem, though: I don't know what version of the
PDF Transcoder is in the Batik 1.5.1 release. That part didn't get
released properly. It could be that the font configuration doesn't work,
but I hope so.


Jeremias Maerki


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

-
Disclaimer
-

This message(including attachment if any)is confidential and may be 
privileged.Before opening attachments please check them
for viruses and defects.MindTree Consulting Private

Handling multiple spaces

2004-12-22 Thread Saptarshi Sen
Hi,
We are using FOP to convert SVG images into PDF. The SVG images are
generated using a tool called PopChart.

When we view the SVG image, multiple spaces are collapsed into a
single space. This can be offset using the xml:space=preserve attribute in
the text tags. Is there any other method by which we can preserve multiple
spaces.

Since I do not have any control over the SVG image produced by
PopChart, can I set any parameters during the FOP call? Alternatively, I
could include the  xml:space=preserve attribute in my text tags, but this
would be very messy. Is there an easier approach?

Thanks,
Saptarshi.
-
Disclaimer
-

This message(including attachment if any)is confidential and may be 
privileged.Before opening attachments please check them
for viruses and defects.MindTree Consulting Private Limited (MindTree)will not 
be responsible for any viruses or defects or
any forwarded attachments emanating either from within MindTree or outside.If 
you have received this message by mistake please notify the sender by return  
e-mail and delete this message from your system. Any unauthorized use or 
dissemination of this message in whole or in part is strictly prohibited.  
Please note that e-mails are susceptible to change and MindTree shall not be 
liable for any improper, untimely or incomplete transmission.

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

RE: Handling multiple spaces

2004-12-22 Thread Saptarshi Sen
The xml:space=preserve attribute does not seem to have any effect on the
PDF generated. The SVG image is within a fo:instream-foreign-object tag. I
could not find any attribute that will preserve white spaces.

I am attaching a typical fo file that we generate.

Thanks,
Saptarshi.

 pieUnicodeSVG.fo 

  -Original Message-
 From: Saptarshi Sen  
 Sent: Wednesday, December 22, 2004 12:54 PM
 To:   FOP Mailing List (E-mail)
 Subject:  Handling multiple spaces
 
 Hi,
   We are using FOP to convert SVG images into PDF. The SVG images are
 generated using a tool called PopChart.
 
   When we view the SVG image, multiple spaces are collapsed into a
 single space. This can be offset using the xml:space=preserve attribute
 in the text tags. Is there any other method by which we can preserve
 multiple spaces.
 
   Since I do not have any control over the SVG image produced by
 PopChart, can I set any parameters during the FOP call? Alternatively, I
 could include the  xml:space=preserve attribute in my text tags, but this
 would be very messy. Is there an easier approach?
 
 Thanks,
 Saptarshi.


pieUnicodeSVG.fo
Description: pieUnicodeSVG.fo
-
Disclaimer
-

This message(including attachment if any)is confidential and may be 
privileged.Before opening attachments please check them
for viruses and defects.MindTree Consulting Private Limited (MindTree)will not 
be responsible for any viruses or defects or
any forwarded attachments emanating either from within MindTree or outside.If 
you have received this message by mistake please notify the sender by return  
e-mail and delete this message from your system. Any unauthorized use or 
dissemination of this message in whole or in part is strictly prohibited.  
Please note that e-mails are susceptible to change and MindTree shall not be 
liable for any improper, untimely or incomplete transmission.

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

FOP distorting images

2004-12-07 Thread Saptarshi Sen
Hi,
I am trying to generate PDF images (charts with embedded fonts) using
FOP version 0.20.5.

We first generate a SVG image using a charting tool called PopChart
(version 5.1.0). We then create the 'fo' file from this SVG. This is finally
fed to FOP to generate the PDF.

In doing so, legends in the chart are overlapping - the chart is
getting cutoff on the right hand side.

The SVG image is actually fine - which leads me to believe that the
problem crops up at the 'fo to pdf' stage. Attached alongwith are the SVG and
FO files as well as the PDF generated using FOP.

Can anyone help me with this?

Thanks,
Saptarshi.

 1102408131024.fo  1102408131024.SVG  1102408131024_fop.pdf 


1102408131024.fo
Description: 1102408131024.fo


1102408131024.SVG
Description: 1102408131024.SVG


1102408131024_fop.pdf
Description: 1102408131024_fop.pdf
-
Disclaimer
-

This message(including attachment if any)is confidential and may be 
privileged.Before opening attachments please check them
for viruses and defects.MindTree Consulting Private Limited (MindTree)will not 
be responsible for any viruses or defects or
any forwarded attachments emanating either from within MindTree or outside.If 
you have received this message by mistake please notify the sender by return  
e-mail and delete this message from your system. Any unauthorized use or 
dissemination of this message in whole or in part is strictly prohibited.  
Please note that e-mails are susceptible to change and MindTree shall not be 
liable for any improper, untimely or incomplete transmission.

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

RE: FOP distorting images

2004-12-07 Thread Saptarshi Sen
Hi Chris,
I think I have got the reason for the problem - it is a font issue.
The SVG created refers to the font 'CF TradeGothic CondEighteen Bold';
However, there is no such font declared in my userconfig.xml file.

I have attached my config file.

Regards,
Saptarshi.


-Original Message-
From: Chris Bowditch [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 07, 2004 7:28 PM
To: [EMAIL PROTECTED]
Subject: Re: FOP distorting images


Saptarshi Sen wrote:

 Hi,
   I am trying to generate PDF images (charts with embedded fonts) using
 FOP version 0.20.5.
 
   We first generate a SVG image using a charting tool called PopChart
 (version 5.1.0). We then create the 'fo' file from this SVG. This is
finally
 fed to FOP to generate the PDF.
 
   In doing so, legends in the chart are overlapping - the chart is
 getting cutoff on the right hand side.
 
   The SVG image is actually fine - which leads me to believe that the
 problem crops up at the 'fo to pdf' stage. Attached alongwith are the SVG
and
 FO files as well as the PDF generated using FOP.

Why couldnt the problem be with the SVG to FO conversion that you mention
above?

snip/

Chris


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

!--!DOCTYPE configuration SYSTEM config.dtd--
!--
 this file contains templates which allow an user easy
 configuration of Fop. Actually normally you don't need this configuration
 file, but if you need to change configuration, you should
 always use this file and *not* config.xml.
 Usage: java org.apache.fop.apps.Fop -c userconfig.xml -fo fo-file -pdf pdf-file
--


configuration

!--
baseDir: normally the base directory is the directory where the fo file is
 located. if you want to specify your own, uncomment this entry.
 This value can also be a URL. Actually, the value is converted to
 a URL.
--
!--
  entry
keybaseDir/key
value/value
  /entry
--

!--
fontBaseDir: Similar to baseDir, except that this value is used for fonts. If
 it isn't specified, the value from baseDir is used.
--
!--
  entry
keyfontBaseDir/key
value/value
  /entry
--

!--

HYPHENATION

--

!--
   hyphenation directory
   if you want to specify your own directory with hyphenation pattern
   then uncomment the next entry and add the directory name
--

!--
  entry
keyhyphenation-dir/key
value/java/xml-fop/hyph/value
  /entry
--



entry
   keystrokeSVGText/key
   valuefalse/value
/entry









!--

  Add fonts here

--

fonts
 !-- example --

 font metrics-file=TRADE_GOTHIC.xml kerning=yes embed-file=TRADE_GOTHIC.ttf
font-triplet name=TradeGothic style=normal weight=normal/
 /font
 font metrics-file=FUTURA_BOOK.xml kerning=yes embed-file=FUTURA_BOOK.ttf
font-triplet name=Futura Book style=normal weight=normal/
 /font
 font metrics-file=FUTURA_COND_LIGHT.xml kerning=yes embed-file=FUTURA_COND_LIGHT.ttf
font-triplet name=Futura CondensedLight style=normal weight=normal/
 /font
 font metrics-file=FUTURA_HEAVY.xml kerning=yes embed-file=FUTURA_HEAVY.ttf
font-triplet name=Futura Heavy style=normal weight=normal/
 /font
 font metrics-file=FUTURA_MEDIUM.xml kerning=yes embed-file=FUTURA_MEDIUM.ttf
font-triplet name=Futura Medium style=normal weight=normal/
 /font
 font metrics-file=TRADE_GOTHIC_BOLD.xml kerning=yes embed-file=TRADE_GOTHIC_BOLD.ttf
font-triplet name=TradeGothic Bold style=normal weight=normal/
 /font
 font metrics-file=TRADE_GOTHIC_BOLD_COND20.xml kerning=yes embed-file=TRADE_GOTHIC_BOLD_COND20.ttf
font-triplet name=TradeGothic CondEighteen style=normal weight=bold/
 /font
 font metrics-file=TRADE_GOTHIC_COND_18.xml kerning=yes embed-file=TRADE_GOTHIC_COND_18.ttf
font-triplet name=TradeGothic CondEighteen style=normal weight=normal/
 /font

 font metrics-file=times.xml kerning=yes embed-file=times.ttf
font-triplet name=TimesRoman style=normal weight=normal/
 /font
 font metrics-file=timesbold.xml kerning=yes embed-file=timesbd.ttf
font-triplet name=TimesRoman style=normal weight=bold/
 /font
 font metrics-file=timesitalic.xml kerning=yes embed-file=timesi.ttf
font-triplet name=TimesRoman style=italic weight=normal/
 /font
 font metrics-file=timesitalicbold.xml kerning=yes embed-file=timesbi.ttf
font-triplet name=TimesRoman style=italic weight=bold/
 /font

font metrics-file=arial.xml kerning=yes embed-file=arial.ttf
font-triplet name=Arial style=normal weight=normal/
 /font
 font metrics-file=arialbold.xml kerning=yes embed-file=arialbd.ttf
font-triplet name

RE: MICR font in FOP as an embedded application..

2004-11-04 Thread Saptarshi Sen
Hi Anil,
We are using FOP to convert SVG images - FO - PDF. After forming
the FO file, we issue a command to FOP to convert it to a PDF. The call to
FOP goes somewhat like this:

String[] args = new String[]{-c, userConfigFile, -fo, inputFile,
-pdf, outputFile};

try {
CommandLineOptions options = new CommandLineOptions(args);
Starter starter = options.getStarter();
starter.run();

} catch (FOPException fopEx) {
} catch (FileNotFoundException fnfEx) { 
}

Here, userConfigFile, inputFile and outputFile are the paths of the
respective files. If you check the Fop.java source code, it does a similar
thing in it's main() method.

Regards,
Saptarshi.

-Original Message-
From: Anil R. Pinto [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 04, 2004 10:29 AM
To: [EMAIL PROTECTED]
Subject: RE: MICR font in FOP as an embedded application..


Thanks guys,

As the userconfig xml within the jar s not being used, I guess I'll stick to
the approach mentioned by Saptarshi, which hapens to also be the one
suggested on the Apache FOP website, except one thing, in the embedded mode
we need to use the org.apache.fop.apps.Options class that represents the
'-c' switch used for the command line option.

If anyone has any other approach I'll be more than happy to hear from them.

Thanks everyone.
Anil

-Original Message-
From: Chris Bowditch [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 03, 2004 7:35 PM
To: [EMAIL PROTECTED]
Subject: Re: MICR font in FOP as an embedded application..


Anil R. Pinto wrote:

snip/

 But, the main requirement is to use this behavior with FOp running as an
 embeded application (using fop.jar).

 Can someone please guide me to a thread that covers this ?

How to use a config file in an embedded environment is described on the
website:

http://xml.apache.org/fop/embedding.html#config-external


 I am lost as to where should the custom font-metrics xml and
userconfig.xml
 file reside when using the standard fop.jar (as the userconfig.xml already
 exists in the jar)

Yes, there is indeed a userconfig.xml in FOP.jar, but its not used!

snip/

Chris


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

-
Disclaimer
-

This message(including attachment if any)is confidential and may be 
privileged.Before opening attachments please check them
for viruses and defects.MindTree Consulting Private Limited (MindTree)will not 
be responsible for any viruses or defects or
any forwarded attachments emanating either from within MindTree or outside.If 
you have received this message by mistake please notify the sender by return  
e-mail and delete this message from your system. Any unauthorized use or 
dissemination of this message in whole or in part is strictly prohibited.  
Please note that e-mails are susceptible to change and MindTree shall not be 
liable for any improper, untimely or incomplete transmission.

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

Conversion of a SVG image (RGB) into PDF (CMYK)

2004-10-25 Thread Saptarshi Sen
Hi,
I am trying to convert an image in SVG format into a PDF using FOP.
The SVG image uses the RGB color scheme. How can I ensure that the PDF output
from FOP uses the CMYK color scheme?

The SVG image is obtained using a charting tool, Corda PopChart,
which does not support CMYK. Also, the SVG image (and hence the final PDF)
contains fonts embedded within it.

Thanks,
Sappy.

-
Disclaimer
-

This message(including attachment if any)is confidential and may be 
privileged.Before opening attachments please check them
for viruses and defects.MindTree Consulting Private Limited (MindTree)will not 
be responsible for any viruses or defects or
any forwarded attachments emanating either from within MindTree or outside.If 
you have received this message by mistake please notify the sender by return  
e-mail and delete this message from your system. Any unauthorized use or 
dissemination of this message in whole or in part is strictly prohibited.  
Please note that e-mails are susceptible to change and MindTree shall not be 
liable for any improper, untimely or incomplete transmission.

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

Error while trying to open PDF(created using FOP) in Adobe Illustrator

2004-09-22 Thread Saptarshi Sen
Hi,
We tried to generate a pdf (an image) with embedded fonts and are
facing a problem. The process that we are following is outlined below.

Process
1.  We first generate a SVG image of the Chart using Corda PopChart
version 5.1.
- The reason for choosing SVG as an intermediate image format is that
it supports embedding of fonts (which reduces the file size). If we try to
generate a PDF directly using PopChart, the fonts are not embedded and the
image file turns out to be pretty bulky.
2.  Data from the generated SVG is extracted and fed to the Apache FOP
(Formatting Objects Processor).
3.  The FOP generates the PDF version of the SVG image.

Problem
The PDF generated does not open in Adobe Illustrator. In Illustrator version
9, it says that Missing Double-byte fonts have been substituted with the
default font. In version 11 CS, it says that Acrobat PDF File Format is
having difficulties. Could not create internal representation of XMP
metadata.

However, these images open up fine in Adobe Acrobat, Acrobat Reader as well
as Adobe PhotoShop. Also, if we open the image in Adobe Acrobat and save it
again, subsequently it opens up fine in Illustrator.

It is important that we be able to edit it using Illustrator as that is what
the users of the system will be using. We are looking for reasons as to why
it's not working; are we missing out any detail?

Attached alongwith are the following files:
1.  109...svg - This is the SVG image generated by PopChart. Opens up
fine in IE.
2.  109...fo - Intermediate file produced by FOP.
3.  109...pdf - Final PDF generated by FOP.


Thanks and Regards,
Saptarshi.



  1094899742704.fo  1094899742704.pdf  1094899742704.svg 



DISCLAIMER:
This message (including attachment if any) is confidential and may be 
privileged. Before opening attachments please check them for viruses and 
defects. MindTree Consulting Private Limited (MindTree) will not be responsible 
for any viruses or defects or any forwarded attachments emanating either from 
within MindTree or outside. If you have received this message by mistake please 
notify the sender by return  e-mail and delete this message from your system. 
Any unauthorized use or dissemination of this message in whole or in part is 
strictly prohibited.  Please note that e-mails are susceptible to change and 
MindTree shall not be liable for any improper, untimely or incomplete 
transmission.


1094899742704.fo
Description: 1094899742704.fo


1094899742704.pdf
Description: 1094899742704.pdf


1094899742704.svg
Description: 1094899742704.svg
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]