Re: Out of Memory problem

2005-02-25 Thread Manisha Sathe
Thanks Chris,

Would appreciate ifu can explain more how shall i increase memory in my case -

I am on Tomcat server andusing servlet to render the fop. I am not using fop.bat file, Which script starts my JVM - really speaking i also do not know. 

My servlet.jar / fop.jar and related files are inside /WEB-INF/lib directory. I am compiling all files thr ant (all class path is set in CLASSPATH)

How can i increase memoryso as to get correct font and pdf in my case?

regards
Manisha


Chris Bowditch [EMAIL PROTECTED] wrote:
Manisha Sathe wrote: I am trying for one Chinese PDF. When i do not make use of Arial Unicode  MS font then i do not get this error. All chinese characters are  displayed as #. Once i use this font then i get this error (even if it  is just 2-3 pages long - sometimes at very beginning i get the 1 page  report - after that even not that)  I tried the the things mentined such as reduce the size of image, page  sequence (do not know how to increase the JVM memory on fly) - also  reset the Cache etc what ever given in docs, but still same.To increase JVM memory, just change your FOP.bat or whatever script starts your Java VM and specify command line parameter -Xmx256M. The default is 64Mb, which isnt sufficient due to the large number of glyphs in The Arial Unicode font.Chris-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]__Do You Yahoo!?Tired of spam?  Yahoo! Mail has the best spam protection around http://mail.yahoo.com 

Re: Out of Memory problem

2005-02-25 Thread IndianAtTech
Hope this code might helps you

Regards
Sudhakar



import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.channels.FileLock;
import java.util.Properties;

/**
 * Class to have the current application relaunched with enough memory.
 * p
 * Usage:
 *
 * public static void main(String[] argv)
 * {
 *try
 *{
 *   new needMemory().needMemory(400, argv); // 400Mb
limit, 200Mb initial.
 *  ...
 *
 * @author J.F.Lanting
 * @since  07-Oct-2002
 */
public final class NeedMemory
{
   /**
* Environment variable to check for recursive re-launching
(-'needMemory()').
*/
   private final static String launchToken = RELAUNCHEDFORHEAP;


   /**
* Checks if enough memory is available to the VM for this
application and optionally re-launches it.
* p
* If not, the application is re-launched from this copy with:BR
* - the same commandline andBR
* - the same JAVA release.BR
* The operation fails or is blocked because:BR
* 1) this is already a re-launch (something must be wrong),BR
* 2) the amount of memory asked for is  1500Mb which is out of reach.BR
* The first situation is controlled by a property: 'launchToken'.BR
* We relaunch the application with initially 50% of the heap limit
allocated.
* /p
*
* @param needed # of Mb to establish.
* @param commandLine the command line as appearing in 'main()'.
* @throws Exception for excess needs or recursive launches (a bug?).
*/
   public void needMemory(int needed, String[] programCommandLine)
throws Exception
   {
   long available; // What we've got.
   String javaPath;// The path to java or java.exe
   URL u;  // The URL to this class from
the classloader.
   String programPath = null;  // The path to this .jar or
.class if any.
   File directory; // Directory of the .jar or .class file.
   boolean isJarFile;  // If this is run from a .jar file.
   String[] commandVector; // The new commandline for re-launch.
   String s;
   int i;

  if((available = toMegaBytes(Runtime.getRuntime().maxMemory()))  needed)
  {
 if(needed  1500)
 {
throw new Exception
   (IMPOSSIBLE TO MEET REQUEST FOR  + needed +  Mb MEMORY.);
 }
 if(System.getProperty(launchToken) != null)
 {
throw new Exception(FATAL RECURSION IN RE-LAUNCH);
 }

// Where did I come from ?

 u = getClass().getResource(needMemory.class);
 if(u == null)
 {
throw new Exception(CAN'T FIND MY OWN CLASS FILE.);
 }

// Determine the path to a class-file or to a jar-file from the classloader URL:

 s = u.getPath();
 if(s.startsWith(file:/))// It's a jar-file.
 {
isJarFile = true;
if(File.separatorChar == '/') // UNIX|LINUX
{
   s = s.substring(5); // Leaves a / alone.
}
else
{
   s = s.substring(6); // Strips the / away.
}

if((i = s.indexOf(!/))  0)
{
   s = s.substring(0, i);  // Deletes the internal jar path.
}
commandVector = new String[6 + programCommandLine.length];
 }
 else  // In a class file.
 {
isJarFile = false;
if(s.startsWith(/))
{
   s = s.substring(1); // Waste the /.
}
if((i = s.indexOf(.class))  0)
{
   s = s.substring(0, i);  // Drop the extension.
}
commandVector = new String[5 + programCommandLine.length];
 }

 if(s.indexOf(%20) = 0) // Incase the URL contained them.
 {
s = s.replaceAll(%20,  );
 }
 programPath = s;

// Where to find java[w] :

 javaPath = System.getProperty(java.home);
 if(File.separatorChar == '/') // UNIX|LINUX
 {
javaPath += /bin/java;
 }
 else
 {
javaPath += \\bin\\javaw.exe;
 }

// Prepare new commandline :

 commandVector[0] = javaPath;

 needed = (int)(needed * 1.01 + 1); // Allow 1% more plus one.

 commandVector[1] = -Xms + (needed / 2) + m; // Initial heap.
 commandVector[2] = -Xmx + needed + m; // Maximum heap.
 commandVector[3] = -D + RELAUNCHEDFORHEAP + =1;

 directory = new File(programPath);
 if(isJarFile)
 {
commandVector[4] = -jar;
commandVector[5] = directory.getName();
i = 6;
 }
 else
 {
commandVector[4] = directory.getName();
i = 5;
 }
 directory = directory.getParentFile();

Re: Problem with report tail

2005-02-25 Thread Miroslav Pukhalsky
Hi there!

For solving my problem I have done next:

?xml version=1.0 encoding=UTF-8?
xsl:stylesheet version=1.1
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:fo=http://www.w3.org/1999/XSL/Format;
exclude-result-prefixes=fo
xsl:output method=xml version=1.0 omit-xml-declaration=no
indent=yes/

xsl:template match=/
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
!-- Describing pages--
fo:layout-master-set
fo:simple-page-master master-name=main
page-width=210mm
page-height=297mm
margin-top=15mm
margin-bottom=10mm
margin-left=20mm
margin-right=10mm
fo:region-body/
fo:region-after extent=60mm/
/fo:simple-page-master
/fo:layout-master-set

fo:page-sequence master-reference=main
!-- Page Body --
fo:static-content flow-name=xsl-region-after
fo:block overflow=false
fo:retrieve-marker retrieve-class-name=tail
retrieve-boundary=page
   
retrieve-position=last-ending-within-page/
/fo:block
/fo:static-content

!-- Page Body --
fo:flow flow-name=xsl-region-body
xsl:apply-templates select=report/
/fo:flow
/fo:page-sequence
/fo:root
/xsl:template

xsl:template match=report
!-- Report Body --
fo:block

fo:block color=white
fo:block1./fo:block
. Quantity of blocks I got by experimental way. 
. They should cover the same place as tail on the 
. height.
fo:blockN./fo:block
/fo:block
/fo:block

!-- Report Tail --
fo:block
fo:marker marker-class-name=tail
fo:table border-collapse=separate 
  table-layout=fixed
fo:table-column column-width=180mm/
fo:table-body
fo:table-row keep-together=always
fo:table-cell
 
/fo:table-cell
/fo:table-row
/fo:table-body
/fo:table
/fo:marker
/fo:block
/xsl:template
/xsl:stylesheet


It's looks like OK...

Miroslav

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



RE: RE : Contributing to FOP (Re: representative example needed)

2005-02-25 Thread Dennis Myrén








Hi there,





Sorry,

My goal is to post these files, however
there are some work I have to do on them in order to make them look nice and
clean,

I really want to do that before anyone
looks at them, to really get them representative, but I have had a
lot of other work lately,

so I havent been able to finish
them up yet.



For us it has really been what the
transform produces that was critical.

I never took the time to develop nice and
efficient XSLT transforms.

One example is the graphs in those
PDFs, I generate those graphs with an intermediate tool that I wrote
which generates SVG graphs from data and layout input in XML format. This SVG
graphs is first generated as separate files, then copied into the final FO
document at

FO compile time, using XSLT
document() function. This is a rather odd approach which I do not know how I
can best present to the FOP users/developers who might be interested in seeing
the solution, I am therefore thinking of moving these solutions to EXSLT
instead, and use _javascript_ to compute layout and render the graph to SVG.

XSLT itself is unfortunately not enough to
generate these graphs.



I was glad to see there where actually FOP
people that was a bit interested in the work I have done with FOP,

now i do not want to disappoint people by
sending these XSLT transforms that is just not clean enough as of today.







Regards,

Dennis JD Myrén

Developer

Oslo Kodebureau

Tel: (+47) 98
00 11 92

Mail: [EMAIL PROTECTED]

Web: www.oslokb.no











From: David Gagnon
[mailto:[EMAIL PROTECTED] 
Sent: 24. februar 2005 22:08
To: [EMAIL PROTECTED]
Subject: RE : Contributing to FOP
(Re: representative example needed)





Hi all,



 I was looking for
a good example as well those pdf are impressive. I was wondering if the
.fo and .xml regarding those examples have been posted somewhere? I
looked into the bug database and haven`t found them are they available?



Thanks for your help!!

/David







-Message d'origine-
De: Dennis
 Myrén [mailto:[EMAIL PROTECTED] 
Envoyé: February 9, 2005
03:48
À: [EMAIL PROTECTED]
Objet: RE: Contributing to
FOP (Re: representative example needed)



Unfortunately, I get
an error when I try to view those links: 

HTTP Error 403.6 - Forbidden:
IP address of the client has been rejected. 

Internet Information Services
(IIS) 



That was
really awkward, and not what I intended.

The URLs should work by now. Sorry about that.

Here
they are again:

http://dev.oslokb.no:8080/dennis/Sample1.pdf


http://dev.oslokb.no:8080/dennis/Sample2.pdf


http://dev.oslokb.no:8080/dennis/Sample3.pdf




BTW I have a couple
of questions: 

- if we like what we
see (I get an error--see below), can we post this example PDF? 

- if we like what we
see (I get an error--see below), can we post the input files (XSL-FO, XML,
XSLT, etc.)?

Of course you are free to
do that.





Perhaps after you've
participated in the FOP community for some time, and your name becomes familiar
to us (and hopefully made some contributions to the code! :-p) you may be
invited to become a committer for Apache FOP!

I will do my best to get
there!





Maybe I could implement
support for CMYK and Spot colors to get started, if this is of interest to you.

Wouldnt this be
cool?:

fo:block
color=spot(PANTONE 1205 C, 1.0)Hello
FOP/fo:block



Regards,

Dennis JD Myrén

Developer

Oslo Kodebureau

Tel:
(+47) 98 00 11 92

Mail:
[EMAIL PROTECTED]

Web:
www.oslokb.no















From: The Web
Maestro [mailto:[EMAIL PROTECTED] 
Sent: 8. februar 2005 17:18
To: [EMAIL PROTECTED]
Subject: Contributing to FOP (Re:
representative example needed)







Dennis, 







On Feb 8, 2005, at 7:54 AM,
Dennis Myrén wrote: 







I should say a few words
as well. 







I work as a computer
programmer for a small software firm. 







We have thought for a
long time that it is time to give something back to FOP, 





in form of development
contribution. 





I have been programming
PDF components for a long time and know the PDF file format, as well as XSL-FO.






Therefore, i think i
might be able to help out. 





However, we havent really
taken the time for that. Now i think we can do that, so i hereby also let you
know that i am interested in starting to contribute. 









Thanks for the kind
words, and we look forward to receiving PATCHes from you. Here's a link to help
you get started. 







http://xml.apache.org/fop/dev/#patches










3 examples of documents that
we have generated(targeting mass printing for broschure production) you can
find here: 





http://dev.oslokb.no:8080/dennis/Sample1.pdf








http://dev.oslokb.no:8080/dennis/Sample2.pdf








http://dev.oslokb.no:8080/dennis/Sample3.pdf










BTW I have a couple of
questions: 





- if we like what we see
(I get an error--see below), can we post this example PDF? 





- if we like what we see
(I get an error--see below), can we post the input files (XSL-FO, XML, XSLT,
etc.)? 








Performace Barcode4j

2005-02-25 Thread kumar Bandaru
Hi,

Recently,I explored barcode4j and was successful to render barcode using that with all ur help.We suspended that project for a while and now we are into it again.

Just to recap, we were using IDAutomation fonts to render barcode(EAN8) in our application,but we found it has some limitations like font strectch so we tried barcode4j and it worked great.

So we want to explore abt performance as we have decided to go ahead with that,
If iam not wrong,barcode4j creates an image(SVG) to render the barcode in the PDF
we have noticed that it is taking more time to render the image when compared toIDAutomation fonts.

is this the expected behaviour?

appreciate your ideas,

Thanks
Jeremias Maerki [EMAIL PROTECTED] wrote:
On 15.12.2004 12:11:39 kumar Bandaru wrote: Wow Wow Wow! I got the barcodes rendered.Thanks for your suggestions.I started all over again .it worked.Good to hear. :-) As Barcode4J doesn't need Fonts to render the barcode, The only way to increase the barcode size is using the and barcode:module-width ? Iam i right abt this??Yes. What are the defaults barcode4j uses for height and width ??That depends on the symbology in use. Have a look at the following linkwhere you can see the defaults for EAN-8 barcodes:http://barcode4j.krysalis.org/barcode-xml.html#EAN-8 How can i align the barcode within the cell? I tried with text-align property it didnt work.Hmm, technically an instream-foreign-object behaves much like acharacter and therefore you can
 use text-align for this use case, too.The following worked fine here (whether this is on the block or on thetable-cell doesn't really matter):Maybe you are confused because of the quiet zone that is on by default.The quiet zone is necessary so barcode readers can distiguish thebarcode from nearby stuff. You can switch it off like this, ifnecessary:[..][..]Jeremias Maerki-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]
		Do you Yahoo!? 
Yahoo! Mail - Easier than ever with enhanced search. Learn more.

Re: Performace Barcode4j

2005-02-25 Thread Jeremias Maerki
Yes, this is expected behaviour. The path from SVG via Batik to PDF is
suboptimal if speed is an important issue. The SVG generation itself is
very fast, but the conversion from SVG to PDF isn't. In the case of
PostScript output I have a non-standard solution (i.e. doesn't work with
an unmodified FOP 0.20.5) to directly embed the barcode as EPS in the
generated PostScript stream. The same I have started for PDF but only
the painting of the bars is implemented. No human-readable part.

If performance is your biggest concern you need to resort to a barcode
font. There's no faster solution at the moment.

On 25.02.2005 13:47:38 kumar Bandaru wrote:
 Hi,
  
 Recently,I explored barcode4j  and was successful to render barcode
 using that with all ur help.We suspended that project for a while and
 now we are into it again.
  
 Just to recap, we were using  IDAutomation fonts to render barcode(EAN8)
 in our application,but we found it has some limitations like font
 strectch so we tried barcode4j and it worked great.
  
 So we want to explore abt performance as we have decided to go ahead with 
 that,
 If iam not wrong,barcode4j creates an image(SVG) to render the barcode in the 
 PDF
 we have noticed that it is taking more time to render the image when
 compared to IDAutomation  fonts.
  
 is this the expected behaviour?
  
 appreciate your ideas,


Jeremias Maerki


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



Re: RE : Contributing to FOP (Re: representative example needed)

2005-02-25 Thread The Web Maestro
On Feb 25, 2005, at 12:59 AM, Dennis Myrn wrote:
x-tad-biggerHi there,/x-tad-bigger

x-tad-biggerSorry,/x-tad-bigger

x-tad-biggerMy goal is to post these files, however there are some work I have to do on them in order to make them look nice and clean,/x-tad-bigger x-tad-biggerI really want to do that before anyone looks at them, to really get them representative, but I have had a lot of other work lately,/x-tad-bigger x-tad-biggerso I havent been able to finish them up yet./x-tad-bigger

I would say, 'take your time! While we'd love to have those files, I can understand your wanting to clean them up a bit before you submit them to something 'permanent'!

x-tad-biggerFor us it has really been what the transform produces that was critical./x-tad-bigger

x-tad-biggerI never took the time to develop nice and efficient XSLT transforms./x-tad-bigger

If you get stuck, you could ask for a little help on the Mulberry xsl-list (which you can find on the FOP Resources page[1]... plug! plug!)

x-tad-biggerOne example is the graphs in those PDFs, I generate those graphs with an intermediate tool that I wrote which generates SVG graphs/x-tad-biggerx-tad-bigger /x-tad-biggerx-tad-biggerfrom data and layout input in XML format. This SVG graphs is first generated as separate files, then copied into the final FO document at/x-tad-bigger x-tad-biggerFO compile time, using XSLT document() function. This is a rather odd approach which I do not know how I can best present to the FOP/x-tad-biggerx-tad-bigger /x-tad-biggerx-tad-biggerusers/developers who might be interested in seeing the solution, I am therefore thinking of moving these solutions to EXSLT instead, and/x-tad-biggerx-tad-bigger /x-tad-biggerx-tad-biggeruse javascript to compute layout and render the graph to SVG./x-tad-bigger

If the files are in SVG format (and referenced locally), you could just ZIP up all of the files that are required, and post the ZIP archive... That may make the most sense, as the SVG files will be easy to look at and take apart in their own right.

x-tad-biggerXSLT itself is unfortunately not enough to generate these graphs./x-tad-bigger

x-tad-biggerI was glad to see there where actually FOP people that was a bit interested in the work I have done with FOP,/x-tad-bigger x-tad-biggernow i do not want to/x-tad-biggerx-tad-bigger /x-tad-biggerx-tad-biggerdisappoint people by sending these XSLT transforms that is just not clean enough as of today./x-tad-bigger

Like I said, take your time, and if you want some help, either ask here or on the Mulberry XSL-List...

Cheers!

[1]
http://xml.apache.org/fop/resources.html

Web Maestro Clay
-- 
[EMAIL PROTECTED]> - http://homepage.mac.com/webmaestro/>
My religion is simple. My religion is kindness.
- HH The 14th Dalai Lama of Tibet


Font and image problem

2005-02-25 Thread rohit . rastogi

Hi,
I have a strange problem.I have set some custom fonts in the userconfig.xml
. In my java code I am using the
  org.apache.fop.configuration.Configuration.put(baseDir
,baseDir);
code to set my base dir. The problem is the fonts are picked correctly but
if there  is any image in the xml source the
transformer is  not able to pick it since the above code changes the
context path . Does any one have encountered
similar problem ? Please help me in resolving this issue. I need both
custom fonts and image .
Thanks
Rohit



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



RE: Font and image problem

2005-02-25 Thread Victor Mote
[EMAIL PROTECTED] wrote:

 I have a strange problem.I have set some custom fonts in the 
 userconfig.xml . In my java code I am using the
   
 org.apache.fop.configuration.Configuration.put(baseDir
 ,baseDir);
 code to set my base dir. The problem is the fonts are picked 
 correctly but if there  is any image in the xml source the 
 transformer is  not able to pick it since the above code 
 changes the context path . Does any one have encountered 
 similar problem ? Please help me in resolving this issue. I 
 need both custom fonts and image .

Try using the fontBaseDir entry instead of baseDir. See:
http://xml.apache.org/fop/configuration.html#summary-key-value

Victor Mote


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