Re: FOP Trunk

2010-05-27 Thread Venkat Reddy

Hi, Are you in Windows environment?

Eric Douglas wrote:


Hi,
I downloaded the FOP Trunk using the svn checkout, then tried to 
create a project and import it into Eclipse and compile it, and got 
all sorts of errors.  Am I missing something?


First it said it was missing classes.  I selected edit build path and 
added external jars ant.jar and junit-4.8.2.jar I found and downloaded 
seperately.  That fixed a lot of the errors.  It's still saying it 
can't find classes from javax.media.jai.*, 
org.apache.fop.fonts.base14.*, and 
org.apache.fop.fonts.CodePointMapping, and it lists errors in XML 
files and the properties.dtd file (which starts a !DOCTYPE tag and 
never closes it).






Re: FOP Trunk

2010-05-27 Thread Venkat Reddy

Hi Eric,

It is working for me, just downloaded the FOPTrunk source code. I am 
able to run compile ant target successfully, and the classes were 
generated in build folder.
I am in windows environment, don't have an idea why you were unable to 
compile the project?


Venkat.

Eric Douglas wrote:


Hi,
I downloaded the FOP Trunk using the svn checkout, then tried to 
create a project and import it into Eclipse and compile it, and got 
all sorts of errors.  Am I missing something?


First it said it was missing classes.  I selected edit build path and 
added external jars ant.jar and junit-4.8.2.jar I found and downloaded 
seperately.  That fixed a lot of the errors.  It's still saying it 
can't find classes from javax.media.jai.*, 
org.apache.fop.fonts.base14.*, and 
org.apache.fop.fonts.CodePointMapping, and it lists errors in XML 
files and the properties.dtd file (which starts a !DOCTYPE tag and 
never closes it).






Re: Problem while trying to generate Multilingual PDF

2010-05-17 Thread Venkat Reddy
You should use URL for configured TTF (ARIALUNI.TTF) file, like 
'file:///C:/windows/fonts/ARIALUNI.TTF'...


I am able to generate PDF document with japanese fonts using FOP Trunk 
latest version, it should also work with FOP 0.95 with the metrics-url 
attribute.


Venkat.

Srinivas Adusumalli wrote:

Hi,
 
I am facing the routine problem with generating multilingual pdf using 
Apache FOP
 
*Requirement: *We should be able to generate PDF in Asian/multiple 
languages(Japanese, Chinese etcc.,) using Apache FOP
 
*Current Set up: *Current system is using Apache FOP to generate PDF 
in english at the runtime. The .fo file (containing information about 
the blocks and data to be written to PDF) and userconfig 
file(containing information about the fonts) content is constructed at 
the run time based on the data available in the Database.
 
*Solution Tried so far: *After analyzing i found that we need to 
embedd fonts related to japanese or chinese etcc specifically in to 
the PDF, following are the steps I followed to do the same.
 
1) Downloaded latest fop.jar (fop-0.95-bin.zip 
javascript:void('http://mirrors.ecvps.com/apache/xmlgraphics/fop/binaries/fop-0.95-bin.zip'); 
) from http://mirrors.ecvps.com/apache/xmlgraphics/fop/binaries/ 
javascript:void('http://mirrors.ecvps.com/apache/xmlgraphics/fop/binaries/'); 
2) Created font metric files for ARIALUNI and MS Gothic fonts as 
specified at http://www.zvon.org/HowTo/Output/cid-fonts.pdf 
javascript:void('http://www.zvon.org/HowTo/Output/cid-fonts.pdf'); 
3) Ensured that the userconfig.xml has the following font entries
 
font metrics-file=ARIALUNI.xml  kerning=yes 
embed-file=ARIALUNI.TTF
font-triplet name=Arial Unicode MS style=normal 
weight=normal /

/font
 

font metrics-file=msgothic.xml  kerning=yes 
embed-file=msgothic.ttc

font-triplet name=MS-Gothic style=normal weight=normal/
/font

 4) Ensured that .fo file generated uses the above specified font for 
the certain blocks which contains the Japanese text.
 
Even after performing the above steps, I see the content being 
displayed as
 
#12388;#12398;#12467;#12513;#12531;#12488;#12434;#12486;#12473;#12488;
 
or as ?
 
instead of displaying it in Japanese text.
 
*NOTE: *
 
1)* *The japanese text that needs to be displayed is picked from the 
database, and in the database we see the information as 
#12388;#12398;#12467;#12513;#12531;#12488;#12434;#12486;#12473;#12488; 
when we try to view it using TOAD. I am fetching the same information 
and displaying it in one of the text field in the page where in it is 
displaying appropriately as Japanese text (This is because i am 
setting the charset/pageEncoding to UTF-8).
 
2) There was no *MS Gothic.ttf*  in C:\WINDOWS\fonts dir so i have 
used *MS Gothic.ttc *to generate the font metric file for the same 
initially and later i downloaded MSGothic.ttf from internet and tries 
the same , and in the userconfig.xml I tried to specify both (one at a 
time) for *embed-file* property
 
*i tried the following entry once *
** 
 font metrics-file=MSGothic.xml  kerning=yes 
embed-file=MSGothic.*ttf*

 font-triplet name=MS Gothic style=normal weight=normal/
 /font
 
*and then*
** 
 font metrics-file=MSGothic.xml  kerning=yes 
embed-file=MSGothic.*ttc*

 font-triplet name=MS Gothic style=normal weight=normal/
 /font
** 
** 
*Questions I have:*
 
1)  The .fo file created at runtime has the Japanese content as 
#12388;#12398;#12467;#12513;#12531;#12488;#12434;#12486;#12473;#12488; 
isntead of Japanese characters. Is this fine? Enclosed is the sample 
*Template_user10_.fo *file that is getting generated.
 
2) Enclosed are userconfig.xml and font metric files for MS Gothic and 
ARIALUNI. Check if these are fine.
 
3) Guide/Suggest what all we have to in order to properly write Asian 
languages/Japanese/Chinese to PDF's using Apache FOP. The version of 
FOP used in our application is 0.20.5, but i have used 0.95 version to 
generate the metrics file, will it create a problem? Can you please 
guide the appropriate versions to be used during the whole process.
 
Regards,

Srinivas
 
 




TrueType (CID-keyed) font support for Postscript renderer

2010-05-17 Thread Venkat Reddy

Hi,

I am planning to provide TrueType (CID-Keyed) font support for 
Postscript renderer. I have never developed any of the font related code 
for any renderer in FOP as of now.
I had a look at the information provided by Jeremias with the following 
WIKI page


http://wiki.apache.org/xmlgraphics-fop/TrueTypeInPostScript#preview

I felt, this is too high level to understand the complete functionality, 
wants to know a detailed step by step process to implement this 
functionality.
Please can someone help me in this regard, and provide me a more 
detailed approach to achieve this..


Thanks in advance,
Venkat.


[Fwd: [Fwd: SEVERE: Invalid axis rule: unable to draw line]]

2010-04-21 Thread Venkat Reddy

Hi,

I am still looking for some solution over this problem.
Can you please have a look at this problem?

Please check the included previous mails with this mail...

Venkat.
---BeginMessage---

continuation to my previous mail...

I have a look at the source code, the below class is throwing this error...

org.apache.fop.afp.ptoca.LineDataInfoProducer produce

Source:

   public void produce(PtocaBuilder builder) throws IOException {
   builder.setTextOrientation(lineDataInfo.getRotation());
   int x1 = ensurePositive(lineDataInfo.getX1());
   int y1 = ensurePositive(lineDataInfo.getY1());
   builder.absoluteMoveBaseline(y1);
   builder.absoluteMoveInline(x1);
   builder.setExtendedTextColor(lineDataInfo.getColor());

   int x2 = ensurePositive(lineDataInfo.getX2());
   int y2 = ensurePositive(lineDataInfo.getY2());
   int thickness = lineDataInfo.getThickness();
   if (y1 == y2) {
   builder.drawIaxisRule(x2 - x1, thickness);
   } else if (x1 == x2) {
   builder.drawBaxisRule(y2 - y1, thickness);
   } else {
   log.error(Invalid axis rule: unable to draw line);
   return;
   }
   }

Please help me to resolve this problem...

Thanks,
Venkat.
---BeginMessage---

Hi,

SEVERE: Invalid axis rule: unable to draw line

The above error is logged when generating AFP output from the one of the 
fop test case:


FO file :  /fop-trunk/examples/fo/basic/leader.fo

Can some one guide me, how to resolve this problem?

Thanks,
Venkat.

---End Message---
---End Message---


Re: [Fwd: CMYK Color Images with PDF Renderer]

2010-02-16 Thread Venkat Reddy

Hi Max,

Thanks for your response.

I am looking for the classes and methods responsible in handling CMYK 
color images for PDF Renderer.
If you know the classes and methods used in this regard, please mention 
them in your reply.


Thanks,
Venkat.

Max Berger wrote:

Dear Venkat,

in PDF, we actually try not to do the conversion of color spaces, but
rather (if possible), keep the original color space.

PDF has the possibility to add color space for images, and if a color
space was defined in the original image, AND the image loader was able
to keep the information, the image is written into the PDF with the
color space info attached.

AFAIK, the only image readers able to handle color space correctly are
PNG and JPEG. All other image readers default to RGB.

With JPEG, the image is kept in a raw format, and embedded into the
pdf as-is, without even decoding it fully.

Max

2010/2/15 Venkat Reddy vanukuri.ven...@googlemail.com:
  

Hi,

I am still looking for the response from the fop-dev team regarding the
attached mail.
Thanks for your replies in advance.

Venkat.

Hi,

Can anyone know the classes and methods deals with the CMYK colored Images
for PDF Renderer?

I want to know, where exactly the conversion taking palce between RGB and
CMYK color spaces.
I have already worked with AFP and PS renderers for CMYK colored images,
these renderers will use ImageEncodingHelper (XMLGraphicsCommons class) to
render the respective
document with colored images. I thought the same class (ImageEncodingHelper)
is not being used for PDF Renderer.

Can someone give me an idea? where this coversion is taking place?

Thanks,
Venkat.






  




Re: [Fwd: CMYK Color Images with PDF Renderer]

2010-02-16 Thread Venkat Reddy

Hi Jeremias,

Thanks for your detailed information on colored image handling in PDF 
Renderer.


I was actually debugging the source for this know how exactly the 
conversion is happening (based on the AFP Renderer experience). I found 
ImageRenderedAdapter
class, which is using ImageEncodingHelper, but the enableCMYK flag value 
'false' is being passed everytime. I have generated the output with the 
CMYK colored image in the PDF
document, wondered how this encoding is happening without passing 
CMYKflag in ImageEncodingHelper.


I have debugged the source based on the Max comments, and found that 
ImageRawJPEGAdapter is being used instead of ImageRenderedAdapter. The 
ImageEncodingHelper is only being used in ImageRenderedAdapter for the 
images other than
JPEG. I am passing JPEG CMYK image, so ImageRawJPEGAdapter is being used 
here in my case.


Thanks once again for giving me the direction needed...

Venkat.

Jeremias Maerki wrote:

Venkat,

you can easily answer your own questions: You're interested in PDF
output so you start in org.apache.fop.render.pdf, i.e. in the
neighborhood of the PDF Renderer. You look around and see classes like
ImageRenderedAdapter or ImageRawJPEGAdapter in that package. Smells a
lot like image handling. There's also PDFImageHandler* but they will
point you back to Image*Adapter in the end. So it seems there are three
classes of images handled here: JPEG, CCITT and Rendered. Rendered means
RenderedImage, i.e. a decoded bitmap image. JPEG and CCITT are about
undecoded image data. Both JPEG and RenderedImage allow CMYK images, so
you'll have to look at both. Going into ImageRenderedAdapter, you once
again encounter ImageEncodingHelper from XML Graphics Commons.

Last step is setting up your Java debugger, set a breakpoint in there
and you're in the middle of it.

On 16.02.2010 12:17:11 Venkat Reddy wrote:
  

Hi Max,

Thanks for your response.

I am looking for the classes and methods responsible in handling CMYK 
color images for PDF Renderer.
If you know the classes and methods used in this regard, please mention 
them in your reply.


Thanks,
Venkat.

Max Berger wrote:


Dear Venkat,

in PDF, we actually try not to do the conversion of color spaces, but
rather (if possible), keep the original color space.

PDF has the possibility to add color space for images, and if a color
space was defined in the original image, AND the image loader was able
to keep the information, the image is written into the PDF with the
color space info attached.

AFAIK, the only image readers able to handle color space correctly are
PNG and JPEG. All other image readers default to RGB.

With JPEG, the image is kept in a raw format, and embedded into the
pdf as-is, without even decoding it fully.

Max

2010/2/15 Venkat Reddy vanukuri.ven...@googlemail.com:
  
  

Hi,

I am still looking for the response from the fop-dev team regarding the
attached mail.
Thanks for your replies in advance.

Venkat.

Hi,

Can anyone know the classes and methods deals with the CMYK colored Images
for PDF Renderer?

I want to know, where exactly the conversion taking palce between RGB and
CMYK color spaces.
I have already worked with AFP and PS renderers for CMYK colored images,
these renderers will use ImageEncodingHelper (XMLGraphicsCommons class) to
render the respective
document with colored images. I thought the same class (ImageEncodingHelper)
is not being used for PDF Renderer.

Can someone give me an idea? where this coversion is taking place?

Thanks,
Venkat.





  
  





Jeremias Maerki


  




[Fwd: CMYK Color Images with PDF Renderer]

2010-02-15 Thread Venkat Reddy

Hi,

I am still looking for the response from the fop-dev team regarding the 
attached mail.

Thanks for your replies in advance.

Venkat.
---BeginMessage---

Hi,

Can anyone know the classes and methods deals with the CMYK colored 
Images for PDF Renderer?


I want to know, where exactly the conversion taking palce between RGB 
and CMYK color spaces.
I have already worked with AFP and PS renderers for CMYK colored images, 
these renderers will use ImageEncodingHelper (XMLGraphicsCommons class) 
to render the respective
document with colored images. I thought the same class 
(ImageEncodingHelper) is not being used for PDF Renderer.


Can someone give me an idea? where this coversion is taking place?

Thanks,
Venkat.

---End Message---


CMYK Color Images with PDF Renderer

2010-02-12 Thread Venkat Reddy

Hi,

Can anyone know the classes and methods deals with the CMYK colored 
Images for PDF Renderer?


I want to know, where exactly the conversion taking palce between RGB 
and CMYK color spaces.
I have already worked with AFP and PS renderers for CMYK colored images, 
these renderers will use ImageEncodingHelper (XMLGraphicsCommons class) 
to render the respective
document with colored images. I thought the same class 
(ImageEncodingHelper) is not being used for PDF Renderer.


Can someone give me an idea? where this coversion is taking place?

Thanks,
Venkat.


Re: Color Image conversion CMYK to RGB

2010-01-15 Thread Venkat Reddy

Hi Jeremias,

Jeremias Maerki wrote:

Hi Venkat

Actually, with AFP, I'm not sure it would be a good idea to enable CMYK
support by default. Some AFP implementations don't even support RGB
colors. And CMYK images are only supported with FS42 and FS45 IOCA
function sets which haven't always been there and are not supported by
every AFP environment. I understand the intention behind your post, but
I would vote for leaving it like this in the case of AFP.

On 15.01.2010 15:25:51 Venkat Reddy wrote:
  

Hi,

I am trying to generate AFP output document from a XSL:FO input document 
having a CMYK color image in it.

I have changed the configuratin (fop.xconf) to the following

images mode=color/

When i generate the AFP document, the CMYK image is converted to RGB 
image, because I haven't set the cmyk=true in the above images tag.


We are checking the property cmyk in AFPRendererConfigurator for the 
value (true/false), if not assigning the default 'false'.


  if (IMAGES_MODE_COLOR.equals(imagesMode)) {
customizable.setColorImages(true);

boolean cmyk = imagesCfg.getAttributeAsBoolean(cmyk, false);
customizable.setCMYKImagesSupported(cmyk);
}

I think, by default we should set this property 'cmyk' to true instead 
of false. When I pass the CMYK image without this property, the image is 
converted to RGB, which I don't want to happen unless I set the property 
to false.


Please pass your comments on this

Thanks,
Venkat.








Jeremias Maerki


  

Thanks for your quick reply.
I understood your point, more over the configuration is only one 
additional step in case user wants to render CMYK color images.

So, I will be not making any changes regarding this.

Thanks,
Venkat.


Re: Thoughts on Bug 48237

2009-11-24 Thread Venkat Reddy

Hi Peter,

There is no bug with this functionality. You can have a look at the FO 
file that I have used...


1. Update the configuration file for the image mode (b+w  or  color)
2. Run the following command from the command prompt...
   *C:\mywork\FOP\fop-0.95 fop -c C:\fop.xconf -fo 
C:\mywork\JavaXSLTSamples\XSLFOSamples\hello.fo -afp 
C:\mywork\JavaXSLTSamples\XSLFOSamples\hellotest.afp

*
According to the mode, the image will be rendered with color or black 
and white...


Thanks,
Venkat.


Peter Hancock wrote:
At present FOP does not respect an image color setting of 'b+w' when 
rendering svg to afp (see Bug 48237)


According to the AFP spec 
(http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/HA3N1M00/7.47.1?SHELF=APSBK320DT=20001002123303 
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/HA3N1M00/7.47.1?SHELF=APSBK320DT=20001002123303) 
it does not seem possible to specify a grayscale color space, and so 
my  question is how should colour be controlled?


Since AFPGraphics2D is responsible for setting the color on the MODCA 
GraphicsObject prior to calling drawing  methods,  would a sensible 
fix to the problem be to convert the awt.Color before calling this setter?


Any thoughts would be most welcome,

Pete


?xml version=1.0 encoding=UTF-8?
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
	fo:layout-master-set
		fo:simple-page-master master-name=page
			fo:region-body 
margin-right=0.5in 
margin-left=0.5in 
margin-bottom=1in 
margin-top=0.5in 
region-name=body/
		/fo:simple-page-master
	/fo:layout-master-set
	fo:page-sequence master-reference=page
	fo:flow flow-name=body
		fo:block break-before=page top=4in
		Testing image fo:external-graphic src=C:\mywork\JavaXSLTSamples\XSLFOSamples\blue.png/ in between words
		/fo:block
	/fo:flow
	/fo:page-sequence
/fo:root

[Fwd: Re: Conversion of CMYK Image into RGB Image]

2009-11-23 Thread Venkat Reddy

Hi Jeremias,

I am able to create JPG/TIFF image using CMYK color space with another 
imaging tool by name 'PhotoLine', but failed to create other extensions 
(GIF,PNG etc...). Please suggest me, if you have any other tool, which 
can create

these image extensions (GIF,PNG etc..).

Thanks,
Venkat.
---BeginMessage---

Hi Jeremias,

I have created CMYK color images with *.tif extension, but failed to 
create the same image as GIF,JPEG. The Corel Photo Paint X4 converting 
CMYK color space to default RGB color space when saving as GIF and JPEG 
etc.
Could you please tell me, how do I create GIF and JPEG images with CMYK 
color space? If this tool doesn't support, please specify another tool...


Thanks,
Venkat.

Jeremias Maerki wrote:

Hi Venkat,

that's [1], method encodeRenderedImageAsRGB() in the case of PostScript
output.

[1] 
http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/ImageEncodingHelper.java?view=markup

HTH

On 03.11.2009 17:39:51 Venkat Reddy wrote:
  

Hi,

As Jeremias stated in the other mail,

*[Currently, bitmaps are encoded in sRGB if a CMYK bitmap is encountered for 
the PostScript render]*

Please someone point me to this source code, where the conversion happening for CMYK to RGB. I have given the 
PSImageUtils class by the Jeremias, but failed to find the code related to this.


Thanks in advance,
Venkat.







Jeremias Maerki


  



---End Message---


Re: [Fwd: Re: Conversion of CMYK Image into RGB Image]

2009-11-23 Thread Venkat Reddy

Hi Jeremias,

Thank you very much for your reply.

Venkat.

Jeremias Maerki wrote:

Hi Venkat

GIF and PNG both don't support CMYK images, so you can ignore those
formats. I suggest to concentrate on TIFF and JPEG only when it comes to
CMYK support.

Sorry for not getting back to you on the other issues. I've been on
holidays the past few days and I still have a lot to catch up. I'll look
at everything as soon as possible.

On 23.11.2009 15:56:07 Venkat Reddy wrote:
  

Hi Jeremias,

I am able to create JPG/TIFF image using CMYK color space with another 
imaging tool by name 'PhotoLine', but failed to create other extensions 
(GIF,PNG etc...). Please suggest me, if you have any other tool, which 
can create

these image extensions (GIF,PNG etc..).

Thanks,
Venkat.






Jeremias Maerki


  




Re: Conversion of CMYK Image into RGB Image

2009-11-17 Thread Venkat Reddy

Hi Jeremias,

I have created CMYK color images with *.tif extension, but failed to 
create the same image as GIF,JPEG. The Corel Photo Paint X4 converting 
CMYK color space to default RGB color space when saving as GIF and JPEG 
etc.
Could you please tell me, how do I create GIF and JPEG images with CMYK 
color space? If this tool doesn't support, please specify another tool...


Thanks,
Venkat.

Jeremias Maerki wrote:

Hi Venkat,

that's [1], method encodeRenderedImageAsRGB() in the case of PostScript
output.

[1] 
http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/ImageEncodingHelper.java?view=markup

HTH

On 03.11.2009 17:39:51 Venkat Reddy wrote:
  

Hi,

As Jeremias stated in the other mail,

*[Currently, bitmaps are encoded in sRGB if a CMYK bitmap is encountered for 
the PostScript render]*

Please someone point me to this source code, where the conversion happening for CMYK to RGB. I have given the 
PSImageUtils class by the Jeremias, but failed to find the code related to this.


Thanks in advance,
Venkat.







Jeremias Maerki


  




Conversion of CMYK Image into RGB Image

2009-11-03 Thread Venkat Reddy

Hi,

As Jeremias stated in the other mail,

*[Currently, bitmaps are encoded in sRGB if a CMYK bitmap is encountered for 
the PostScript render]*

Please someone point me to this source code, where the conversion happening for CMYK to RGB. I have given the 
PSImageUtils class by the Jeremias, but failed to find the code related to this.


Thanks in advance,
Venkat.




TLE value truncation (AFP extension)

2009-10-20 Thread Venkat Reddy

Hi,

Please help me in finding the code related to this TLE value truncation 
happening for more than 254 bytes. The corresponding bug is already 
raised...


https://issues.apache.org/bugzilla/show_bug.cgi?id=47941

The MODCA documentation clearly states that 254 bytes allowed for the TLE 
value. I would like to take your inputs before digging into the code...

1. Is the behaviour correct (truncating after 254 bytes)?
2. Do we need to warn the user in this case?

Please point me to the code points and guide me to resolve this problem, if you 
can...

Thanks,
Venkat.



Re: Making AFPPaintingState singleton

2009-10-16 Thread Venkat Reddy

Hi Adrian,

Thanks for your reply.

Yes, You are absolutely right, I am trying to handle these conversions 
at the renderer level... I will soon come out with a patch to the bug 
you opened.


Thanks once again for the source points,
Venkat.

Adrian Cumiskey wrote:

Hi Venkat,

This approach is not a good idea.  It is possible that a runtime 
environment is configured to have multiple instances of Fop being 
instantiated by FopFactory with different rendering configurations 
(e.g. renderer resolution values).


Its disappointing, but I've just noticed a bug in 
AFPPageOverlayElement, an AFPPaintingState shouldn't just be 
instantiated in there like that.  The processNode implementation will 
not accurately calculate and plot the page overlay position if the 
document resolution is different from the detault value of 240dpi.  
This calculation should be carried out much later at rendering time, 
*not* in here at configuration time - its very hacky and you'll need 
to refactor this.  I seem to remember that Chris worked on this new 
feature so you may want to converse with him about its implementation.


Adrian.

Venkat Reddy wrote:

Hi,

AFPPaintingState is being used in three different places altogether 
in FopTrunk source. The default constructor is being used in the 
following three classes...


1. AFPDocumentHandler.java
2. AFPRenderer.java
3. AFPPageOverlayElement.java

There is a variable 'resolution' is being initialized for each 
instance, this resolution parameter can be set using the 'fop.xconf' 
for a particular render...


Ex:- AFPRenderer configuration below

renderer mime=application/x-afp
 !--
  The bit depth and type of images produced
  (this is the default setting)
 --
 images mode=b+w bits-per-pixel=8/
 renderer-resolution1400/renderer-resolution


The above renderer-resolution is being hardcoded as '240dpi' in 
AFPRendererConfigurator.java, which initiates the renderer resolution 
based on the configuration set in 'fop.xconf'. In order to resolve 
this problem, I will be changing the AFPPaintingState as singleton, 
so that all the above classes will get the instance using 
'getInstance()' method instead of default constructor. This will 
resolve the renderer-resolution problem as well, by a simple change 
in AFPRendererConfigurator (instead of hardcoded value 240, assigning 
the value from the configuration object).


Please review the above changes and tell me, if I am doing anything 
wrong here?


Thanks,
Venkat.








Making AFPPaintingState singleton

2009-10-15 Thread Venkat Reddy

Hi,

AFPPaintingState is being used in three different places altogether in 
FopTrunk source. The default constructor is being used in the following 
three classes...


1. AFPDocumentHandler.java
2. AFPRenderer.java
3. AFPPageOverlayElement.java

There is a variable 'resolution' is being initialized for each instance, 
this resolution parameter can be set using the 'fop.xconf' for a 
particular render...


Ex:- AFPRenderer configuration below

renderer mime=application/x-afp
 !--
  The bit depth and type of images produced
  (this is the default setting)
 --
 images mode=b+w bits-per-pixel=8/
 renderer-resolution1400/renderer-resolution


The above renderer-resolution is being hardcoded as '240dpi' in 
AFPRendererConfigurator.java, which initiates the renderer resolution 
based on the configuration set in 'fop.xconf'. In order to resolve this 
problem, I will be changing the AFPPaintingState as singleton, so that 
all the above classes will get the instance using 'getInstance()' method 
instead of default constructor. This will resolve the 
renderer-resolution problem as well, by a simple change in 
AFPRendererConfigurator (instead of hardcoded value 240, assigning the 
value from the configuration object).


Please review the above changes and tell me, if I am doing anything 
wrong here?


Thanks,
Venkat.


Re: Page Overlay (IPO) Extension

2009-10-02 Thread Venkat Reddy

Hi Jeremias,

Thanks for your help. I have done few changes to the 
AFPPageSetupElement.java, and the offset coordinates are working infact. 
I just want to know more on your other point mentioned in your reply 
'offset coordinates user-friendly'...


There is some code I have found in

   *org.apache.fop.afp.AFPUnitConverter*

, namely the method

   *public int[] mpts2units(float[] srcPts)*

Is this the same method you are suggesting me to use to map the 
user-friendly offset coordinates to get converted into float values?


Thanks,
Venkat.

Jeremias Maerki wrote:

Venkat,

first of all you probably need to subclass AFPPageSetupElement to add
support for carrying the offset coordinates. AFPElementMapping would
then also need to be changed. Then you'd need to move on to
AFPDocumentHandler.handleExtensionObject where the extension is
converted into calls into the AFP library.
DataStream.createIncludePageOverlay would then also need to be extended.
And so on and on...

I guess one challenge is to make the specification of the offset
user-friendly. I don't think it's acceptable to expect from the user to
know what numeric value would need to be specified to get the right
placing. Maybe you can reuse something from the FO property subsystem to
parse arbitrary lengths, internally work with millipoints and then
convert that to the final value.

On 01.10.2009 16:52:23 Venkat Reddy wrote:
  

Hi,

I want to include X and Y coordinates to the afp:include-page-overlay 
definition, something like below


  afp:include-page-overlay id=IPO001 name=O1tcgas1 *x=300 
y=500*/


in PageObject.java, the following method will be used when there is an 
overlay referenced in a FO document.
public void *createIncludePageOverlay*(String name, *int x, int y*, 
int orientation)


where the X and Y coordinates hardcoded as '0' in *DataStream.java*. I 
want to pass these values through the above page overlay definition, Can 
someone tell me, how do I pass these coordinates?


Thanks,
Venkat.






Jeremias Maerki


  




Page Overlay (IPO) Extension

2009-10-01 Thread Venkat Reddy

Hi,

I want to include X and Y coordinates to the afp:include-page-overlay 
definition, something like below


 afp:include-page-overlay id=IPO001 name=O1tcgas1 *x=300 
y=500*/


in PageObject.java, the following method will be used when there is an 
overlay referenced in a FO document.
   public void *createIncludePageOverlay*(String name, *int x, int y*, 
int orientation)


where the X and Y coordinates hardcoded as '0' in *DataStream.java*. I 
want to pass these values through the above page overlay definition, Can 
someone tell me, how do I pass these coordinates?


Thanks,
Venkat.


Re: Sub Version

2009-09-16 Thread Venkat Reddy

Hi Jeremias,

I apologize for posting this query to fop-dev and fop-users, will follow 
as mentioned.
Generally for all the bugs we commit, we will write the down the 
subversion numbers in that bug for the next user. When the next user 
opens the bug, he will have a direct look into
the code. Agree, what you have said, some bugs may not require any 
changes to source code. I will have a look into the ViewVC URL for the 
details here onwards.


Thanks,
Venkat.

Jeremias Maerki wrote:

Venkat,
please don't cross-post on both dev and users mailing lists. This post
is clearly development-related so belongs on dev. Thanks.

We usually write down the ViewVC URL for the revisions related to a bug.
It's pretty much all we can do do to link the changes to the Bugzilla
tickets. Of course, not all resolved tickets will also result in a
change in SVN. Also, on the other side, we usually mention the bugzilla
ID on any change related to a Bugzilla issue. But what we don't do is
open a Bugzilla ticket for every change we do.

On 15.09.2009 17:01:41 Venkat Reddy wrote:
  

Hi,

I couldn't find any subversion numbers on the bugs which are 
fixed/resolved. I am very new to the FOP users/dev list.
If we don't have a column 'subversion' on the bug, will it be nice to 
write down the subversion number in your comments? so that all the users 
will verify the code easily for the bugs which are resolved.


Thanks,
Venkat.






Jeremias Maerki


  




Re: CMYK Colors

2009-09-16 Thread Venkat Reddy

Hi Jeremias,

Excellent. Thanks for your quick response.

Thanks,
Venkat.

Jeremias Maerki wrote:

On 16.09.2009 14:37:12 Venkat Reddy wrote:
  

Hi,

Can someone please explain me the following queries?

1. What is uncalibrated CMYK color space?



That refers to device-specific CMYK colors, i.e. the author of the
document already has to know which printer a document is printed on and
chooses the colors so they look good on that printer.

In contrast to that: if you're working in a calibrated color space
(established by a color profile), your colors get converted as necessary
in downstream processes in order to recreate the color you intended on
any printer. Well, that's a simplified explanation and color experts
would probably cry out loud, but it's sufficient to explain the
difference.

  

2. What extent the FOP supports this feature?



FOP has a proprietary color function that allows to specify
device-specific/uncalibrated CMYK colors:
http://xmlgraphics.apache.org/fop/trunk/extensions.html#color-functions

I just noticed that I didn't commit some changes that would support a
#CMYK pseudo-color-profile as other XSL-FO implementations use. I'll
have to look into that. It would allow something like this:
rgb-icc(1.0,1.0,0.0,#CMYK,0.0,0.0,1.0,0.0)

  
3. I have got the following fo source code to specify a background color 
from the CMYK color profile, from which I am able to produce all three

differents documents (PDF, AFP, and PS):

?xml version=1.0 encoding=utf-8?
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
 fo:layout-master-set
  fo:simple-page-master master-name=demo
   fo:region-body 
background-color=rgb-icc(100%,0%,0%,CMYKProfile,0,1,1,0)/

  /fo:simple-page-master
 /fo:layout-master-set
 fo:declarations
   fo:color-profile color-profile-name=CMYKProfile 
src=ECI_Offset_2009/ISOcoated_v2_eci.icc/

 /fo:declarations
 fo:page-sequence master-reference=demo
  fo:flow flow-name=xsl-region-body
fo:block color=rgb-icc(0%,0%,0%,CMYKProfile,0,0,0,1)Demo/fo:block
  /fo:flow
 /fo:page-sequence
/fo:root

I have downloaded this fo file from the bug 
https://issues.apache.org/bugzilla/show_bug.cgi?id=43705;.


Does this means FOP supports CMYK feature? (I have used the FOP Trunk 
source for this..)



This is using calibrated CMYK colors. The fo:color-profile element
establishes the ICC color profile under the name CMYKProfile which is
then used for output formats that support ICC profiles (just PDF at the
moment). In PostScript, for example, this is mapped to the sRGB fallback.

  

4. There is a class by name 'CMYKColorSpace.java', when will it be used?



As the javadocs say, it is used for uncalibrated CMYK color, i.e. for
device-specific CMYK color and when there's no ICC color profile.

When you use the cmyk() color function, this class is referenced by the
ColorExt instance representing the CMYK color resulting from evaluating
the cmyk() function.

HTH


Jeremias Maerki


  




Sub Version

2009-09-15 Thread Venkat Reddy

Hi,

I couldn't find any subversion numbers on the bugs which are 
fixed/resolved. I am very new to the FOP users/dev list.
If we don't have a column 'subversion' on the bug, will it be nice to 
write down the subversion number in your comments? so that all the users 
will verify the code easily for the bugs which are resolved.


Thanks,
Venkat.