Re: Newbie question

2009-09-04 Thread Jean-François El Fouly


Le 4 sept. 09 à 03:34, Dola Woolfe a écrit :


I'm trying to put together several elements to build a PDF translator.

1. Load a PDF in a foreign language (???)
2. Translate the content (Google Translate)
3. Output the translated PDF (FOP)

So I'm guessing step 1 is not part of FOP. Can you perhaps recommend  
what I can use for 1.?


Thanks again!


I think you should try iText. You will find an explanation of what you  
need near the end of "iText in Action", the authoritative book by  
Bruno Lowagie, the guy who designed iText in the first place. And  
before proceeding in your project you *should* read the caveats in his  
book: extracting text content from an existing PDF may not be as  
straightforward as you think - in fact may be almost nonsense in  
certain situations. A PDF API will get you the text content in the  
order it was technically generated, which may not be the "textual"  
order (the order you read the elements in a book).
My own experience in top of this is that it is very difficult to  
extract text content from non-European or large fonts (the CID-keyed  
fonts, roughly said, those who have more than WinAnsi or ISO-8859-1  
characters).


HTH,

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



Re: Newbie question

2009-09-04 Thread John Burgess

It doesn't!

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

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




- Original Message -
*From:* Dola Woolfe 
*To:* fop-users@xmlgraphics.apache.org
*Sent:* 04/09/2009 1:02:50 AM +0100
*Subject:* Newbie question



I did my homework, but this does not appear to be an FAQ!

How does FOP read PDF's?

Many thanks in advance,

Dola


  


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

  



The annual Risk Decisions European User Conference will take place on the 12th November 2009, Oxfordshire - 
http://www.riskdecisions.com";>click here to find out more and register to attend.


Re: Newbie question

2009-09-04 Thread Chris Bowditch

John Burgess wrote:

It doesn't!


That isn't 100% accurate. FOP can parse a PDF included as an external 
graphic using an extension developed by Jeremias Maerki. Further details 
and download link to the extension can be found here: 
http://wiki.apache.org/xmlgraphics-fop/HowTo/EmbeddedPdf


Although I realise that isn't quite what the OP asked for. I mention 
this just for the sake of accuracy for the archives.


Thanks,

Chris



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

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



- Original Message -
*From:* Dola Woolfe 
*To:* fop-users@xmlgraphics.apache.org
*Sent:* 04/09/2009 1:02:50 AM +0100
*Subject:* Newbie question



I did my homework, but this does not appear to be an FAQ!

How does FOP read PDF's?

Many thanks in advance,

Dola


  


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

  


The annual Risk Decisions European User Conference will take place on 
the 12th November 2009, Oxfordshire -
click here  to find out more and register 
to attend.



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



Re: Newbie question

2009-09-04 Thread Dola Woolfe


Thank you.

(Sounds like more than the 1 hour  I was allocating for it.)



- Original Message 
From: Jean-François El Fouly 
To: fop-users@xmlgraphics.apache.org
Sent: Friday, September 4, 2009 3:44:55 AM
Subject: Re: Newbie question


Le 4 sept. 09 à 03:34, Dola Woolfe a écrit :

> I'm trying to put together several elements to build a PDF translator.
> 
> 1. Load a PDF in a foreign language (???)
> 2. Translate the content (Google Translate)
> 3. Output the translated PDF (FOP)
> 
> So I'm guessing step 1 is not part of FOP. Can you perhaps recommend what I 
> can use for 1.?
> 
> Thanks again!

I think you should try iText. You will find an explanation of what you need 
near the end of "iText in Action", the authoritative book by Bruno Lowagie, the 
guy who designed iText in the first place. And before proceeding in your 
project you *should* read the caveats in his book: extracting text content from 
an existing PDF may not be as straightforward as you think - in fact may be 
almost nonsense in certain situations. A PDF API will get you the text content 
in the order it was technically generated, which may not be the "textual" order 
(the order you read the elements in a book).
My own experience in top of this is that it is very difficult to extract text 
content from non-European or large fonts (the CID-keyed fonts, roughly said, 
those who have more than WinAnsi or ISO-8859-1 characters).

HTH,

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




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



reference-orientation and tables (FOP 0.95)

2009-09-04 Thread bonekrusher

Hi, please see attached example. I have a table with in a block container
that is rotated 90 degrees. I am having a problem with the cell alignment.
If you look at the pdf output, my cells are centered. I need them to be
aligned bottom (the word "test" should start at the bottom of the cell) 

Any suggestions on how to resolve this?

http://www.nabble.com/file/p25294461/example.fo example.fo 
http://www.nabble.com/file/p25294461/example.png example.png 

Thanks 
-- 
View this message in context: 
http://www.nabble.com/reference-orientation-and-tables-%28FOP-0.95%29-tp25294461p25294461.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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



Re: reference-orientation and tables (FOP 0.95)

2009-09-04 Thread Pascal SANCHO

Hi,

bonekrusher a écrit :

Hi, please see attached example. I have a table with in a block container
that is rotated 90 degrees. I am having a problem with the cell alignment.
If you look at the pdf output, my cells are centered. I need them to be
aligned bottom (the word "test" should start at the bottom of the cell)

Any suggestions on how to resolve this?

http://www.nabble.com/file/p25294461/example.fo example.fo
http://www.nabble.com/file/p25294461/example.png example.png

Thanks
On your fo:b-c, the start-indent property is not null, witch is an 
inherited property.

You should reset it to zero onto the inner fo:table.

that should work.

Pascal

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



RE: reference-orientation and tables (FOP 0.95)

2009-09-04 Thread Amick, Eric
All of the table-cells have display-align="center", so I'm not surprised
it's coming out that way. Am I missing something?

Eric Amick
LCS
Office of the Clerk

-Original Message-
From: bonekrusher [mailto:djs...@yahoo.com] 
Sent: Friday, September 04, 2009 9:33
To: fop-users@xmlgraphics.apache.org
Subject: reference-orientation and tables (FOP 0.95)


Hi, please see attached example. I have a table with in a block
container
that is rotated 90 degrees. I am having a problem with the cell
alignment.
If you look at the pdf output, my cells are centered. I need them to be
aligned bottom (the word "test" should start at the bottom of the cell) 

Any suggestions on how to resolve this?

http://www.nabble.com/file/p25294461/example.fo example.fo 
http://www.nabble.com/file/p25294461/example.png example.png 

Thanks 
-- 
View this message in context:
http://www.nabble.com/reference-orientation-and-tables-%28FOP-0.95%29-tp
25294461p25294461.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


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



Re: reference-orientation and tables (FOP 0.95)

2009-09-04 Thread bonekrusher

Pascal et al,

Thanks... this was actually causing another problem on a nested table also. 

Thanks a bunch

Phil



-- 
View this message in context: 
http://www.nabble.com/reference-orientation-and-tables-%28FOP-0.95%29-tp25294461p25294844.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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



Re: Newbie question

2009-09-04 Thread J.Pietschmann

On 04.09.2009 15:22, Dola Woolfe wrote:

(Sounds like more than the 1 hour  I was allocating for it.)


PDF as a format isn't meant to be parsed for advanced text processing,
it was designed for presentation. PDF generators could make your job
of parsing text out of the file arbitrarily hard. As an extreme (and 
rather theoretical) example, a PDF could contain two text streams

"Tiset" and "hsiatx", with embedded positioning commands, which
reads on the screen as "This is a text". In any case, even putting
up reasonable guards against running into out-of-order text blocks
will take a few days, unless you find a ready-to-use library for
this task (no, I don't have pointers).

If you can, try to get your source text in a more processing-friendly
format, like DocBook XML.

J.Pietschmann

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



Re: 0.95 text wrap issue

2009-09-04 Thread Andreas Delmelle

On 03 Sep 2009, at 18:19, Griffin,Sean wrote:

Hi Senthil, Sean,


1. Remove keep-together on the table-cell.  In this contrived  
example you wouldn't need it.  Not sure if that affects the  
hyphenation behavior or not.


It shouldn't. Specifying an explicit "keep-*.within-column" does not  
affect line-breaking. If it was plain "keep-together", this remark  
would have been spot on, since that would also set the .within-line  
component.


I'm assuming hyphenation was not completely set up.

2. Ensure you have the xml:lang attribute on the page-sequence  
element containing this block or the hyphenation either won't work  
or won't work correctly.


This can indeed be a possible cause. If 'language' is not explicitly  
set, it defaults to "none", an obscure language for which OFFO does  
not have hyphenation patterns yet... ;-)



Regards,

Andreas


Andreas Delmelle
mailto:andreas.delmelle.AT.telenet.be
jabber: mandr...@jabber.org
skype: adlm0608

---


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



fo:table breaks in fo:block-container

2009-09-04 Thread bonekrusher

Hi,

I have a table inside a fo:block-container. The block-container's
orientation is 90 degrees (see attached). When the table rows exceeds the
table width, the table does not break to the next page. I've attached a
working example. How do I get the the table to break to the next page?

http://www.nabble.com/file/p25300387/example2.png example2.png 
http://www.nabble.com/file/p25300387/example.fo example.fo 

Thanks,

Phil
-- 
View this message in context: 
http://www.nabble.com/fo%3Atable-breaks-in-fo%3Ablock-container-tp25300387p25300387.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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



Re: fo:table breaks in fo:block-container

2009-09-04 Thread Andreas Delmelle

On 04 Sep 2009, at 21:22, bonekrusher wrote:

Hi Phil


I have a table inside a fo:block-container. The block-container's
orientation is 90 degrees (see attached). When the table rows  
exceeds the
table width, the table does not break to the next page. I've  
attached a

working example. How do I get the the table to break to the next page?


Short answer: you can't. Not with FOP, at any rate.

Longer answer:
I remember playing with a similar case in the past, and realized back  
then that what you seem to expect, is strictly speaking not possible  
in standard XSL-FO 1.1, unless you were to rotate the entire region- 
body.
IIRC, some commercial implementations offer proprietary extensions to  
allow such breaks to be produced. FOP unfortunately does not, yet...


As for the standard: When would the block-container break to the next  
page?
Answer: when its block-progression-dimension exceeds the available  
space in block-progression-direction.
Now, keep in mind that reference-orientation appears to change block/ 
inline-progression-direction for everything that lies *inside* the b-c  
(= it establishes a new coordinate system *within* the b-c's viewport- 
area).
The b-c's height is still its extent in the block-progression- 
direction of the region, which will be determined by the width of its  
content (assuming height="auto", as in your sample)
If the content's height is greater than the region-body's width, then  
that is considered overflow in inline-progression-direction. If we had  
overflow="scroll" implemented for AWT, you would at most get a  
scrollbar.
From the point of view of the flow, the block-container's height can  
never exceed the height of the region-body, unless the content's width  
is greater than the region's height.
Even then, FOP chooses to let the content overflow, rather than  
breaking. Rotated block-containers are never broken. (*)


ATM, I'm unsure as to how much/little effort it would take to change  
this. It seems quite possible to allow the nested Breaker to return  
multiple parts instead of removing all breaks, as it does now. That's  
the easy part.
I see a possible difficulty for a block-container that starts, say in  
the middle of a page. On the next page, there is more available space  
for the content-width, but at the time the breaks are first computed,  
we don't really know yet how much that will be. We can only assume it  
is equal to the 'current' available height.
Support for changing page-width has been added to Trunk recently, but  
when only the page-height changes, nothing special happens, and we  
could still get overflow as a result...


(*) Technically: for regular block-containers, the element list is  
inlined into the eventual sequence returned by the FlowLayoutManager  
to the PageBreaker. On the other hand, rotated or absolute-positioned  
block-containers are processed/broken by a nested  
BlockContainerLayoutManager.BlockContainerBreaker, whose  
isSinglePartFavored() returns true. Basically, what the outer  
PageBreaker gets to see here, is a single block.






http://www.nabble.com/file/p25300387/example2.png example2.png
http://www.nabble.com/file/p25300387/example.fo example.fo

Thanks,

Phil
--
View this message in context: 
http://www.nabble.com/fo%3Atable-breaks-in-fo%3Ablock-container-tp25300387p25300387.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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




Regards,

Andreas Delmelle
mailto:andreas.delmelle.AT.telenet.be
jabber: mandr...@jabber.org
skype: adlm0608

---


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



Re: fo:table breaks in fo:block-container

2009-09-04 Thread bonekrusher

Thanks Andreas,

A bit over my head :). I guess I can break the tables up as the documents is
not often updated.

Thanks again

Phil

-- 
View this message in context: 
http://www.nabble.com/fo%3Atable-breaks-in-fo%3Ablock-container-tp25300387p25303179.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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