Craig Ringer | 1 Sep 07:19 2010
Picon

Re: PDF: Disable converting color to "Device Gray"

On 30/08/10 22:47, Jeremias Maerki wrote:
> FOP doesn't have such an option. The PDF 1.4 spec says in chapter 6.2.1:
> "A gray level is equivalent to an RGB value with all three components
> the same."
> 
> And therefore we render gray values in the DeviceGray color space. That
> this doesn't work in your case is a bit surprising. But I've heard
> something similar just two weeks ago from a company that does photo
> books with FOP/Batik. But they had to do strange things like using CMYK
> and adding Magenta in addition to the K=1.0 value. They still just get
> an approximate black. I guess that's an issue of the printer they use. I
> suspect your case may be similar: a printer issue.

It's often an issue with the RIP or preflight tools, rather than the
printer/press its self.

ICC-aware RIPs will use ICC color space transforms to convert RGB
colours in a given space to the output device space - usually a custom
CMYK profile for the printer/press. /DeviceGray is a different colour
space to /DeviceRGB and the /DeviceGray to CMYK conversion is a
different mapping to the RGB one, potentially done with different
profiles. Some RIPs just convert /DeviceGray to /DeviceRGB then do the
transform from RGB, but that's not necessarily correct, especially in a
tagged document where there are mulitiple colour spaces in the same
co-ordinate system, like sRGB and AdobeRGB.

A proper configuration will use a greyscale profile that matches the RGB
profile. That's not very common, though, and really only works out where
the assumed greyscale curve happens to match the chosen or assumed RGB
profile.
(Continue reading)

Craig Ringer | 1 Sep 07:53 2010
Picon

Re: Memory Leak issue -- FOP

On 30/08/10 22:29, Hamed Mohammed wrote:
> Hi,
>  
> This is how I am using FOP to process XSL.FO <http://XSL.FO> into PDF. I
> agree that the issue is to do with too much of memory consumption. Is
> there a better way to process this large FO file into PDF using FOP?

How much memory is too much? Have you used the JVM's tools to find out
*where* the memory is going?

If you don't know Java's profiling tools well, you might want to try the
rather user-friendly memory profiler in NetBeans. NetBeans opens Maven
projects directly, and can be set up for a generic Ant project quite
quickly, so if you're not already using it there's no reason not to just
for this.

> String xml = builder.getReport(); /// gets the XSL:FO file data approx 50mb

If you're concerned about memory consumption, writing your XSL-FO to a
tempfile rather than an in-memory string and passing that to FOP's SAX
engine would be a big help. Or, for that matter, writing directly to the
SAX handler's InputStream, progressively generating the document as it's
required so it never has to exist entirely in memory or on disk.

> PdfStorage pdfHolder = pdfStorageFactory.createStorage(reportRequest,

What's PdfStorage? It doesn't seem to be in fop's packages...

Any chance you can post a self-contained test program that demonstrates
the problem you describe, along with sample input for it?
(Continue reading)

Chris Bowditch | 1 Sep 09:57 2010
Picon

Re: How to include .fo file into another .fo

Shaki wrote:
> Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:

<snip/>

> 
>> 2. If you have an XInclude-capable XML parser (or a SAX filter for
>> XInclude), you can use XInclude.
>>
>> http://en.wikipedia.org/wiki/XInclude
>> http://www.w3.org/TR/xinclude/

<snip/>

> 
> I am using Apache FOP. My attempt with XInclude failed.
> 
> File to be included: 2.pdf 
> <fo:block font-size="20pt">
>    Address block
> </fo:block>  
> 
> Master file:
> <fo:block>
>   <xi:include href="2.fo" parse="xml" xmlns:xi="http://www.w3.org/2001/XInclude">
>     <xi:fallback>Include Error</xi:fallback>    
>   </xi:include>
> </fo:block>

You are using relative paths in the reference. Did you try specifying a 
(Continue reading)

Dmitro Zakotey | 1 Sep 14:26 2010
Picon

Heading Styles

Hi

I want to be able to export html containing h1, h2, etc headings to RTF format file, where each html heading will be imported as corresponding heading style, so that it will be possible to generate a table of contents for such a document in Word. Is it possible?

Thank you.

Regards,
Dmitro

Eric Douglas | 1 Sep 15:46 2010

RE: Orientation

If I assign the page-height=11" and page-width=8.5" and reference-orientation=90 it works perfectly, except the PDF and print preview appear sideways.
 
If I assign the page-height=8.5" and page-width=11" and reference-orientation=0 it works for PDF and print preview but really confuses the printer.  After prompting for paper in the manual feed tray, the printer prints it landscaped on portrait, so it's running off the right edge and cutting off the bottom.
 
There is a workaround for this, but is there a solution?  The most obvious workaround is to transform it both ways keeping 2 copies in memory, one for preview and PDF and one for sending to the printer.  This is acceptable only if the transform is a fast process and the memory usage is small enough where doubling it is not a concern.  I can't reasonably hold just one or the other in memory if I want to be able to send it to the printer while the preview is active...
 

From: Stuart Scott [mailto:Stuart.Scott <at> countrywide.co.uk]
Sent: Wednesday, August 25, 2010 7:00 AM
To: fop-users <at> xmlgraphics.apache.org
Subject: RE: Orientation

Hi Eric

 

I tried mine with option 2 and the landscape page does indeed print out portrait. 

 

So if you want a landscape page in the middle of portrait pages for viewing only, option 2 is the better option.  If you want the same to print only, option 1 is the best.  If you want both I think you have a problem.

 

I am not sure if this would be considered a bug or something that could be considered for a future FOP release.

 

Are you able to use two separate stylesheets, one using each option?

 

Kind regards

 

Stuart Scott

 

From: Eric Douglas [mailto:edouglas <at> blockhouse.com]
Sent: 20 August 2010 16:13
To: fop-users <at> xmlgraphics.apache.org
Subject: RE: Orientation

 

That is the reference-orientation=90 option I tried.  That works well, though I don't think users want to view it sideways.

There are 2 ways to print landscape, I've determined.  See attached.

The first one involves setting page-height=11" and page-width=8.5" and reference-orientation=90.

The second one  involves setting page-height=8.5" and page-width=11" and reference-orientation=0.

The issues with that:

1. The first method prints fine if I create a pageable object from the FOP output (using embedded code with the output stream) and send it straight to the printer using the Java PrintService with default options, only assigning JobName.

The second method sent straight to the printer goes to tray 1 (manual feed) instead of the default tray 3, asking for 8.50" x 11.00" paper, and after putting the paper in it prints portrait.

2. I couldn't figure out how to get the second method working with mixed output, getting one page to print portrait and the next to print landscape.

 

The first method seems unusable if it can't turn sideways by default when the users view the PDF, to read like the second one.

The second method seems unusable if I can't get it to come out on the printer like the first one does.

 

 

From: Stuart Scott [mailto:Stuart.Scott <at> countrywide.co.uk]
Sent: Friday, August 20, 2010 9:55 AM
To: fop-users <at> xmlgraphics.apache.org
Subject: RE: Orientation

Hi Eric

 

I am not sure I fully understand your issue, so can you take a look at page 4 in the attached PDF.  Is that what you are after?

 

Kind regards

 

Stuart Scott

 

From: Eric Douglas [mailto:edouglas <at> blockhouse.com]
Sent: 20 August 2010 14:00
To: fop-users <at> xmlgraphics.apache.org
Subject: Orientation

 

Maybe I was just thinking too far out of the box, but I was wondering if it's possible to create output with different pages having different orientation.

I tried just swapping the page-height and page-width attribute values and had a couple of issues with it.  For a PDF, if I set the first page to portrait and the second page to landscape it was making both pages landscape.  On getting the output directly to the printer that was somehow selecting the wrong tray.

I've tried setting the reference-orientation value to 90.  I haven't gotten a test that worked with portrait and landscape in the same output, but this works well for landscape directly to the printer.  The problem with this value is when I create a PDF and try to view it, the pages actually show as sideways.

On sending output directly to the printer I'm actually generating a pageable object from the FOP output and using the javax.print.PrintService class.  I was wondering if just setting the javax.print.attribute.standard.PresentationDirection and/or javax.print.attribute.standard.OrientationRequested value would work best for printing landscape, though of course this would not allow portrait and landscape pages in the same output.

The only other way I can think of to get portrait and landscape orientation in the same output would be to create different xml files for each and process them separately, though of course this would require some method of combining the output to get one PDF, and it would break xsl code like fo:page-number-citation ref-id="last-page".

For email disclaimer details please click or visit - http://www.countrywideplc.co.uk/disclaimer

Adam Kovacs | 1 Sep 15:56 2010

Table with spanned-row-header in 2 columned region-body

Hi There!

 Im trying to make a table with a spanned header in a 2 columned region-body.
(Examples attached....)
I would need something like a "span=all" into the table-header... like this:

<fo:region-body region-name="PageBody" column-count="2"/>

        <fo:table>
               <fo:table-column>
                <fo:table-column>
                <fo:table-header >
<fo:table-row span="all">
                   <fo:table-cell number-columns-spanned="2">
                       <fo:block> T1H1</fo:block>
                   </fo:table-cell>
</fo:table-row>
<fo:table-row>
                   <fo:table-cell>
                       <fo:block> T1H2C1</fo:block>
                   </fo:table-cell>
                   <fo:table-cell>
                       <fo:block> T1H2C2</fo:block>
                   </fo:table-cell>
               </fo:table-row>
                </fo:table-header>
                <fo:table-body >


It should look like this:

"_______Table Header 1______"
"TableHeader2"    "TableHeader2"
"ContentRow _"    "ContentRow _"
"ContentRow _"    "ContentRow _"
"ContentRow _"    "ContentRow _"
...

-Page Break-

"_______Table Header 1______"
"TableHeader2"    "TableHeader2"
"ContentRow _"    "ContentRow _"
"ContentRow _"    "ContentRow _"
"ContentRow _"    "ContentRow _"

Any idea how to do this is really appreciated!!!
Thanks!

Attached is an example XSL/FO and PDF what I would need... (the blue one is the desired one just also over page breaks....)

Attachment (test_2header.pdf): application/pdf, 9 KiB

Attachment (test_2header.xml): application/xml, 47 KiB


Adam 
Using FOP 1.0
Georg Datterl | 1 Sep 16:00 2010
Picon

AW: Table with spanned-row-header in 2 columned region-body

Hi Adam,

 

I don’t think that’s possible, because logically your table has only one column and therefore the TH1 could only span one column. But: What if you put the TH1 into the page header and let it span there?

 

Regards,

 

Georg Datterl

 

------ Kontakt ------

 

Georg Datterl

 

Geneon media solutions gmbh

Gutenstetter Straße 8a

90449 Nürnberg

 

HRB Nürnberg: 17193

Geschäftsführer: Yong-Harry Steiert

 

Tel.: 0911/36 78 88 - 26

Fax: 0911/36 78 88 - 20

 

www.geneon.de

 

Weitere Mitglieder der Willmy MediaGroup:

 

IRS Integrated Realization Services GmbH:    www.irs-nbg.de

Willmy PrintMedia GmbH:                            www.willmy.de

Willmy Consult & Content GmbH:                 www.willmycc.de

 

Von: Adam Kovacs [mailto:a.kovacs <at> i-docs.com]
Gesendet: Mittwoch, 1. September 2010 15:57
An: fop-users <at> xmlgraphics.apache.org
Betreff: Table with spanned-row-header in 2 columned region-body

 

Hi There!

 

 Im trying to make a table with a spanned header in a 2 columned region-body.

(Examples attached....)

I would need something like a "span=all" into the table-header... like this:

 

            <fo:region-body region-name="PageBody" column-count="2"/>

 

        <fo:table>

                        <fo:table-column>

                        <fo:table-column>

                <fo:table-header >

                                   <fo:table-row span="all">

                               <fo:table-cell number-columns-spanned="2">

                                   <fo:block> T1H1</fo:block>

                               </fo:table-cell>

                                   </fo:table-row>

                                   <fo:table-row>

                               <fo:table-cell>

                                   <fo:block> T1H2C1</fo:block>

                               </fo:table-cell>

                               <fo:table-cell>

                                   <fo:block> T1H2C2</fo:block>

                               </fo:table-cell>

                           </fo:table-row>

                </fo:table-header>

                <fo:table-body >

 

 

It should look like this:

 

"_______Table Header 1______"

"TableHeader2"    "TableHeader2"

"ContentRow _"    "ContentRow _"

"ContentRow _"    "ContentRow _"

"ContentRow _"    "ContentRow _"

...

 

-Page Break-

 

"_______Table Header 1______"

"TableHeader2"    "TableHeader2"

"ContentRow _"    "ContentRow _"

"ContentRow _"    "ContentRow _"

"ContentRow _"    "ContentRow _"

 

Any idea how to do this is really appreciated!!!

Thanks!

 

Attached is an example XSL/FO and PDF what I would need... (the blue one is the desired one just also over page breaks....)

 

Steffanina, Jeff | 1 Sep 16:03 2010

Placing the minus sign(-) to the RIGHT side of the number

I am using FOP to produce an invoice in a .PDF.   Everything works.
However, when a negative number is produced in my right justified table column, the minus sign causes the decimal point to be mis-aligned.
I found the "format-number" function and this addresses the problem.  Now the issue is that my system generates a negative value in the form of:
     233.94-
(the minus sign is always to the right of the value)  This cannot be changed.   When I submit the value to "format-number", it returns a "NaN" error.
 
select="format-number(inv-amt,'##,###.00;#####.00-')"
 
In summary, I need to produce a column of numbers, right justified, some of the values are negative with the minus sign to the right.  At the same time, the vertical alignment of the decimal point is required. 
 
Any ideas?
 
Thanks.
 
Jeff
 
Eric Douglas | 1 Sep 16:20 2010

RE: Placing the minus sign(-) to the RIGHT side of the number

This seems relatively simple.
I assume the problem is that your data has 233.94- and format-number requires -223.94.
I don't know the syntax offhand but there is a method in the xsl to check the last character of the data field.
You could just use the value of (if {last character} = "-") for an xsl:choose condition to parse the inv-amt input field, to move the "-" to the front with a concat() function then pass the result into the format-number.
 
(of course it's even easier the way I did it, where the program generating the XML data already formats numbers into text and calculates absolute positioning to print them)

From: Steffanina, Jeff [mailto:Jeff.Steffanina <at> marriott.com]
Sent: Wednesday, September 01, 2010 10:03 AM
To: fop-users <at> xmlgraphics.apache.org
Subject: Placing the minus sign(-) to the RIGHT side of the number

I am using FOP to produce an invoice in a .PDF.   Everything works.
However, when a negative number is produced in my right justified table column, the minus sign causes the decimal point to be mis-aligned.
I found the "format-number" function and this addresses the problem.  Now the issue is that my system generates a negative value in the form of:
     233.94-
(the minus sign is always to the right of the value)  This cannot be changed.   When I submit the value to "format-number", it returns a "NaN" error.
 
select="format-number(inv-amt,'##,###.00;#####.00-')"
 
In summary, I need to produce a column of numbers, right justified, some of the values are negative with the minus sign to the right.  At the same time, the vertical alignment of the decimal point is required. 
 
Any ideas?
 
Thanks.
 
Jeff
 
Adam Kovacs | 1 Sep 16:23 2010

Re: AW: Table with spanned-row-header in 2 columned region-body

Hi Georg!

Thanks for your answer... Im exactly looking after workaround-ideas like this!

The problem is that I have lets say 3 Tables with the same content type but exactly this "spanned" header different..
I dont know how long these tables are.
It can happen that the 1. table is 3 pages the 2. is 2 pages and the 3. is 20 pages...
(Imagine it like Tables: "Videos" "Photos" "Music" and content like "title" "author" "date")

So I think the page-header is no option.
Or is there a way to set it dynamically?

Thanks!!

Adam 

On 01.09.2010, at 16:00, Georg Datterl wrote:

Hi Adam,

 

I don’t think that’s possible, because logically your table has only one column and therefore the TH1 could only span one column. But: What if you put the TH1 into the page header and let it span there?

 

Regards,

 

Georg Datterl

 

------ Kontakt ------

 

Georg Datterl

 

Geneon media solutions gmbh

Gutenstetter Straße 8a

90449 Nürnberg

 

HRB Nürnberg: 17193

Geschäftsführer: Yong-Harry Steiert

 

Tel.: 0911/36 78 88 - 26

Fax: 0911/36 78 88 - 20

 

 

Weitere Mitglieder der Willmy MediaGroup:

 

IRS Integrated Realization Services GmbH:    www.irs-nbg.de

Willmy PrintMedia GmbH:                            www.willmy.de

Willmy Consult & Content GmbH:                 www.willmycc.de

 

Von: Adam Kovacs [mailto:a.kovacs <at> i-docs.com] 
Gesendet: Mittwoch, 1. September 2010 15:57
An: fop-users <at> xmlgraphics.apache.org
Betreff: Table with spanned-row-header in 2 columned region-body

 

Hi There!

 

 Im trying to make a table with a spanned header in a 2 columned region-body.

(Examples attached....)

I would need something like a "span=all" into the table-header... like this:

 

            <fo:region-body region-name="PageBody" column-count="2"/>

 

        <fo:table>

                        <fo:table-column>

                        <fo:table-column>

                <fo:table-header >

                                   <fo:table-row span="all">

                               <fo:table-cell number-columns-spanned="2">

                                   <fo:block> T1H1</fo:block>

                               </fo:table-cell>

                                   </fo:table-row>

                                   <fo:table-row>

                               <fo:table-cell>

                                   <fo:block> T1H2C1</fo:block>

                               </fo:table-cell>

                               <fo:table-cell>

                                   <fo:block> T1H2C2</fo:block>

                               </fo:table-cell>

                           </fo:table-row>

                </fo:table-header>

                <fo:table-body >

 

 

It should look like this:

 

"_______Table Header 1______"

"TableHeader2"    "TableHeader2"

"ContentRow _"    "ContentRow _"

"ContentRow _"    "ContentRow _"

"ContentRow _"    "ContentRow _"

...

 

-Page Break-

 

"_______Table Header 1______"

"TableHeader2"    "TableHeader2"

"ContentRow _"    "ContentRow _"

"ContentRow _"    "ContentRow _"

"ContentRow _"    "ContentRow _"

 

Any idea how to do this is really appreciated!!!

Thanks!

 

Attached is an example XSL/FO and PDF what I would need... (the blue one is the desired one just also over page breaks....)

 



Gmane