RE: How to create 3D pdf with FOP 1.1

2014-03-31 Thread Sebastien HO
Hi, 

Yes it could be a possibility to contact the university which sponsored the 
project and ask them if they could release the sources. I am new to FOP group, 
how are extensions maintained? Is there an user group that is dedicated to 
maintain official extensions?

Regards, 

Sébastien

-Message d'origine-
De : Simon Steiner [mailto:simonsteiner1...@gmail.com] 
Envoyé : vendredi 28 mars 2014 16:43
À : fop-users@xmlgraphics.apache.org
Objet : RE: How to create 3D pdf with FOP 1.1

Hi,

Seems this doesn’t work, maybe plugin could be updated for this functionality.

Thanks

-Original Message-
From: Simon Steiner [mailto:simonsteiner1...@gmail.com]
Sent: 28 March 2014 15:27
To: fop-users@xmlgraphics.apache.org
Subject: RE: How to create 3D pdf with FOP 1.1

Hi,

You can create a PDF with 3d content then embed that pdf in your output pdf 
using external-graphic and pdfplugin.

http://xmlgraphics.apache.org/fop/fop-pdf-images.html

Thanks

-Original Message-
From: Sebastien HO [mailto:s...@traceparts.com]
Sent: 28 March 2014 14:56
To: fop-users@xmlgraphics.apache.org
Subject: RE: How to create 3D pdf with FOP 1.1

Hi, 

I am referring to the ability to directly embed 3D content within PDF documents 
(u3d file for instance).  I saw that there is an extension available for FOP 
0.85  (http://www.cgv.tugraz.at/CGV/People/people/berndt/FO3D) .  I have tested 
it and it works fine on FOP 0.85. 

As I would like to benefit of new feature of FOP 1.1, I wanted to know if it 
exists in FOP 1.1 :
- A project to migrate FO3D on FOP 1.1. 
- Any other way to embed 3D element in pdf as to create a 3DPdf (may be a 
special elements in XSLT?). 

Thanks for your help,

Regards, 

Sébastien.
 

-Message d'origine-
De : Pascal Sancho [mailto:psancho@gmail.com] Envoyé : vendredi 28 mars 
2014 10:02 À : fop-users@xmlgraphics.apache.org Objet : Re: How to create 3D 
pdf with FOP 1.1

Hi,

are you speaking about 3D artwork?
AFAIK, there is no such extension against latest FOP release.

Also, note that this feature is part of PDF 1.6 spec (see [1] §9.5, p 746).
FOP v1.1 produces PDF 1.4 by default, but implements some PDF 1.5 features.
(target PDF version can be changed up to 1.7 in config since FOP v1.1, see [2]).

[1] 
http://stuff.mit.edu/afs/sipb/contrib/doc/specs/software/adobe/pdf/PDFReference16-v4.pdf
[2] http://xmlgraphics.apache.org/fop/1.1/configuration.html#pdf-renderer


2014-03-27 9:06 GMT+01:00 Sebastien HO s...@traceparts.com:
 Hi,



 I would like to know if there is an extension to create a 3D pdf with 
 FOP 1.1.  I found out on the web that an phd student has done an 
 extension for FOP 0.85 but since FOP Version  1.0 changed its design 
 the extension doesn’t work anymore.

 Does anyone plan to migrate/create a extension?



 Regards,



 Sébastien



--
pascal

-
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




-
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: How to create 3D pdf with FOP 1.1

2014-03-28 Thread Sebastien HO
Hi, 

I am referring to the ability to directly embed 3D content within PDF documents 
(u3d file for instance).  I saw that there is an extension available for FOP 
0.85  (http://www.cgv.tugraz.at/CGV/People/people/berndt/FO3D) .  I have tested 
it and it works fine on FOP 0.85. 

As I would like to benefit of new feature of FOP 1.1, I wanted to know if it 
exists in FOP 1.1 :
- A project to migrate FO3D on FOP 1.1. 
- Any other way to embed 3D element in pdf as to create a 3DPdf (may be a 
special elements in XSLT?). 

Thanks for your help,

Regards, 

Sébastien.
 

-Message d'origine-
De : Pascal Sancho [mailto:psancho@gmail.com] 
Envoyé : vendredi 28 mars 2014 10:02
À : fop-users@xmlgraphics.apache.org
Objet : Re: How to create 3D pdf with FOP 1.1

Hi,

are you speaking about 3D artwork?
AFAIK, there is no such extension against latest FOP release.

Also, note that this feature is part of PDF 1.6 spec (see [1] §9.5, p 746).
FOP v1.1 produces PDF 1.4 by default, but implements some PDF 1.5 features.
(target PDF version can be changed up to 1.7 in config since FOP v1.1, see [2]).

[1] 
http://stuff.mit.edu/afs/sipb/contrib/doc/specs/software/adobe/pdf/PDFReference16-v4.pdf
[2] http://xmlgraphics.apache.org/fop/1.1/configuration.html#pdf-renderer


2014-03-27 9:06 GMT+01:00 Sebastien HO s...@traceparts.com:
 Hi,



 I would like to know if there is an extension to create a 3D pdf with 
 FOP 1.1.  I found out on the web that an phd student has done an 
 extension for FOP 0.85 but since FOP Version  1.0 changed its design 
 the extension doesn’t work anymore.

 Does anyone plan to migrate/create a extension?



 Regards,



 Sébastien



--
pascal

-
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



How to create 3D pdf with FOP 1.1

2014-03-27 Thread Sebastien HO
Hi, 

 

I would like to know if there is an extension to create a 3D pdf with FOP
1.1.  I found out on the web that an phd student has done an extension for
FOP 0.85 but since FOP Version  1.0 changed its design the extension
doesn’t work anymore.

Does anyone plan to migrate/create a extension?

 

Regards, 

 

Sébastien



Unresolved ID and page-number-citation allocated width

2008-12-01 Thread Sebastien
Hi !
I took a look at a few discussions around this issue on the mailing list and
at the current implementation in FOP Trunk.
Currently i'm having a PDF with several chapters whose content may have some
links pointing to some content in another chapter. These chapters can be
generated separately so that some links are unresolved and that's ok.
But my problem is that i attach a page-number-citation to each link like
this:
fo:basic-link color=blue internal-destination=myId
  A link fo:inline baseline-shift=super font-size=8pt
[fo:page-number-citation ref-id=myId/]/fo:inline
/fo:basic-link

The behaviour that i was expecting was to have empty brackets [] when the ID
couldn't be resolved. Instead, i got empty brackets but with a large space
between them [].
After a quick look at the code, i saw that page-number-citation allocates a
space corresponding to the string MMM if the ID can't be immediately
resolved.
My FOP understanding is quite limited so i can't understand how FOP manages
to shrink the space previously allocated when it succeeds in resolving the
ID and why it leaves this MMM-space when it fails to resolve the ID.

So I have two questions:
 1) Is there a way to squeeze that space in case of unresolved ID ? I don't
want to hack the code and replace the MMM string by a | string for
instance, it's ugly and it will surely lead to severe mistakes in the
layout. Is it difficult to implement such a behaviour ? I'm guessing that if
this hasn't been implemented yet it must be because of some tricky
implications and/or issues ?
 2) I can bear not to have any page-number-citation at all in case of
unresolved ID but in this case, i will need to know when my ID can be
resolved and when it can't. It leads to some xsl-testing (i guess) and i
don't think an XSLT processor can be aware of such things... But i may be
wrong and perhaps this cool feature exists ?

Thanks again for your help.

  Seb


Re: Unresolved ID and page-number-citation allocated width

2008-12-01 Thread Sebastien
On Mon, Dec 1, 2008 at 9:39 PM, Andreas Delmelle 
[EMAIL PROTECTED] wrote:

 On 01 Dec 2008, at 17:11, Sebastien wrote:

  My FOP understanding is quite limited so i can't understand how FOP
 manages to shrink the space previously allocated when it succeeds in
 resolving the ID and why it leaves this MMM-space when it fails to resolve
 the ID.

 So I have two questions:
  1) Is there a way to squeeze that space in case of unresolved ID ? I
 don't want to hack the code and replace the MMM string by a | string for
 instance, it's ugly and it will surely lead to severe mistakes in the
 layout. Is it difficult to implement such a behaviour ? I'm guessing that if
 this hasn't been implemented yet it must be because of some tricky
 implications and/or issues ?


 One could try go into the direction of avoiding the addition of the area if
 the link is unresolved. The tricky part is that it's possible the dummy area
 is added, and replaced later, so you have no guarantee, unless you know in
 advance whether the ID will occur on a later page in the document...


What about a mechanism which squeeze all the unresolved page-number-citation
dummy space at the end of the processing ? I didn't really look into FOP's
code so it might very well be a stupid idea and/or an impossible thing to
do...
I just think that since FOP is obviously able to replace a forward reference
when it encounters it, it might be able to replace/squeeze an unresolved
reference as well. But again, i'm surely missing some internal details...




  2) I can bear not to have any page-number-citation at all in case of
 unresolved ID but in this case, i will need to know when my ID can be
 resolved and when it can't. It leads to some xsl-testing (i guess) and i
 don't think an XSLT processor can be aware of such things... But i may be
 wrong and perhaps this cool feature exists ?


 Well, there is a possibility... Assuming that there is some element- or
 attribute-value in the XML source that determines the value of the ref-id/id
 pair, then theoretically, it should be possible to check, at the time the
 page-number-citation node is generated, whether 'myId' in your example, will
 appear anywhere in the result document. If not, then you can simply skip
 generation of the element.


I'm not sure i understood your solution. How would you check that ? (ok, i
saw your second mail, i understand now ;) )

Actually i named my FO ids with a convenient name which is
[chapter]_[number] (eg: actions_52) so i might be able to get a list of
chapters which are generated from my application. Then i would split the
ref-id with the '_' delimiter and compare the first part with the list of
generated chapters and decide whether to add the page-number-citation or
not... But considering all the links in the document, doing a string split +
an array search + a test for each and every one of them seems like a real
pain and i would hate to do that.
Anyways, if i'm stuck with this problem, this will be the way to go i
guess...


Thanks for your answers anyways ;)

  Seb


Re: Add Watermark to PDF file

2008-11-24 Thread Sebastien
Hi,
http://xmlgraphics.apache.org/fop/0.95/output.html#pdf-watermark
It should help you ;)


On Mon, Nov 24, 2008 at 3:48 PM, Ashish Kulkarni 
[EMAIL PROTECTED] wrote:

 Hi

 How can i add watermark to a PDF file, i have to create a Purchase Order
 PDF, where i want the status of PDF like Approved, unapproved as watermark
 of this PDF file

 How can i do so using FOP

 Ash



SVG1.2 and flowRoot in PDF

2008-11-21 Thread Sebastien
Hi,
I would like to use the flowing text abilities of SVG1.2 with FOP but i
can't get FOP to switch to SVG1.2 mode and i get this error:

GRAVE: Exception
org.w3c.dom.DOMException: The current document is unable to create an
element of the requested type (namespace: http://www.w3.org/2000/svg, name:
flowRoot).
at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)

-

org.w3c.dom.DOMException: The current document is unable to create an
element of the requested type (namespace: http://www.w3.org/2000/svg, name:
flowRoot).
at org.apache.batik.dom.AbstractNode.createDOMException(Unknown
Source)
at
org.apache.batik.dom.svg.SVGDOMImplementation.createElementNS(Unknown
Source)
at org.apache.batik.dom.svg.SVGOMDocument.createElementNS(Unknown
Source)
at org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:324)
at
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
at
org.apache.fop.util.DelegatingContentHandler.startElement(DelegatingContentHandler.java:182)
at
org.apache.fop.util.DOMBuilderContentHandlerFactory$Handler.startElement(DOMBuilderContentHandlerFactory.java:124)
at
org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163)
at
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)


I found a thread in the archives which is exactly what i'm trying to do:
http://fop-users.markmail.org/search/?q=flowroot#query:flowroot+page:1+mid:h2oak7zhcds6tvje+state:results

Unfortunately, the answer given by Jeremias (writing version=1.2 in the
svg root tag) didn't help.
Here is the .fo file (the svg part comes from the W3C):


?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 margin-bottom=10mm margin-top=10mm
margin-right=10mm margin-left=10mm page-width=210mm
page-height=297mm master-name=A4-portrait
fo:region-body margin-bottom=10mm margin-top=10mm /
/fo:simple-page-master
/fo:layout-master-set
fo:page-sequence font-size=10pt font-family=times
master-reference=A4-portrait
fo:flow flow-name=xsl-region-body
  fo:block
fo:instream-foreign-object
svg xmlns=http://www.w3.org/2000/svg; version=1.2
width=100mm height=150mm
flowRoot font-size=16
flowRegion
path d=M100,50L50,300L250,300L300,50z/
/flowRegion
flowParaTomorrow, and tomorrow, and tomorrow; creeps
in this
   petty pace from day to day, until the last syllable
of recorded time.
   And all our yesterdays have lighted fools the way to
dusty death.
/flowPara
/flowRoot
/svg
/fo:instream-foreign-object
  /fo:block
/fo:flow
  /fo:page-sequence
/fo:root

However, when i use fo:external-graphic to include the same svg, it works,
or maybe should i say it doesn't crash... The PDF rendering is working, but
the result is just a black parallelogram instead of the text (exactly the
same result as in Firefox 3 for instance). There is only InkScape which
renders the svg correctly.
What am I missing here ?

Thanks for your help ;)


Re: SVG1.2 and flowRoot in PDF

2008-11-21 Thread Sebastien
On Fri, Nov 21, 2008 at 4:16 PM, Jeremias Maerki [EMAIL PROTECTED]wrote:

 I have a pretty good idea why it doesn't work. For i-f-o the basic SVG
 1.1 DOMImplementation is currently hard-coded but it actually needs to
 be selected based on the version attribute like for the e-g variant. I'm
 looking into that.


Ok, thank you very much.



 As for the black parallelogram, I may have to send you over to
 [EMAIL PROTECTED] since the same output appears when
 looking at the SVG in Batik's Squiggle Browser. Setting
 visibility=false fixes that problem. Please note that the SVG 1.2
 flowText feature is not finalized. The spec is still in draft mode. The
 semantics may not be clearly enough defined, yet, and Batik might also
 not do everything correctly, yet.


Actually, i'm just trying to get word wrapping in SVG without using known
hacks such as dividing my text in substrings, each in one in a tspan, or
using tbreak. I can't use them because my text is dynamicaly generated and
the algorythm to find out how it should be split will just be a real pain in
the ass...
So, any other solution allowing me to have word wrapping would be fine for
me ;)


Re: SVG1.2 and flowRoot in PDF

2008-11-21 Thread Sebastien
On Fri, Nov 21, 2008 at 4:37 PM, Jeremias Maerki [EMAIL PROTECTED]wrote:

 I forgot: you also need to enclose the flowPara with a flowDiv element.
 I believe the example in the SVG 1.2 working draft is actually wrong (it
 doesn't conform to the schema given further above in the document).


Yes, the example is clearly wrong (on the webpage, the source code doesn't
even end the flowRoot tag correctly...)


 On 21.11.2008 16:16:30 Jeremias Maerki wrote:
  I have a pretty good idea why it doesn't work. For i-f-o the basic SVG
  1.1 DOMImplementation is currently hard-coded but it actually needs to
  be selected based on the version attribute like for the e-g variant. I'm
  looking into that.
 
  As for the black parallelogram, I may have to send you over to
  [EMAIL PROTECTED] since the same output appears when
  looking at the SVG in Batik's Squiggle Browser. Setting
  visibility=false fixes that problem. Please note that the SVG 1.2
  flowText feature is not finalized. The spec is still in draft mode. The
  semantics may not be clearly enough defined, yet, and Batik might also
  not do everything correctly, yet.
 
  I will report back when I've fixed the first problem above. Shouldn't be
  a biggy.
 
  On 21.11.2008 14:48:15 Sebastien wrote:
   Hi,
   I would like to use the flowing text abilities of SVG1.2 with FOP but i
   can't get FOP to switch to SVG1.2 mode and i get this error:
  
   GRAVE: Exception
   org.w3c.dom.DOMException: The current document is unable to create an
   element of the requested type (namespace: http://www.w3.org/2000/svg,
 name:
   flowRoot).
   at
   org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
   at
 org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)
  
   -
  
   org.w3c.dom.DOMException: The current document is unable to create an
   element of the requested type (namespace: http://www.w3.org/2000/svg,
 name:
   flowRoot).
   at org.apache.batik.dom.AbstractNode.createDOMException(Unknown
   Source)
   at
   org.apache.batik.dom.svg.SVGDOMImplementation.createElementNS(Unknown
   Source)
   at
 org.apache.batik.dom.svg.SVGOMDocument.createElementNS(Unknown
   Source)
   at
 org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:324)
   at
  
 org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
   at
  
 org.apache.fop.util.DelegatingContentHandler.startElement(DelegatingContentHandler.java:182)
   at
  
 org.apache.fop.util.DOMBuilderContentHandlerFactory$Handler.startElement(DOMBuilderContentHandlerFactory.java:124)
   at
   org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163)
   at
  
 org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
   at
 org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
   Source)
   at
 org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown
   Source)
   at
  
 org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
   Source)
   at
  
 org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
   Source)
   at
  
 org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
   Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
   Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
   Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
 Source)
   at
 org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
   Source)
   at
  
 org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
   at
   org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
   at
 org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)
  
  
   I found a thread in the archives which is exactly what i'm trying to
 do:
  
 http://fop-users.markmail.org/search/?q=flowroot#query:flowroot+page:1+mid:h2oak7zhcds6tvje+state:results
  
   Unfortunately, the answer given by Jeremias (writing version=1.2 in
 the
   svg root tag) didn't help.
   Here is the .fo file (the svg part comes from the W3C):
  
  
   ?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 margin-bottom=10mm margin-top=10mm
   margin-right=10mm margin-left=10mm page-width=210mm
   page-height=297mm master-name=A4-portrait

Re: SVG1.2 and flowRoot in PDF

2008-11-21 Thread Sebastien
It works just the way i want, you rock !
Thanks a lot, again ;)

P.S: visibility=hidden does the trick indeed

On Fri, Nov 21, 2008 at 6:26 PM, Jeremias Maerki [EMAIL PROTECTED]wrote:

 Found a solution that works:
 http://svn.apache.org/viewvc?rev=719646view=rev

 On 21.11.2008 17:47:22 Jeremias Maerki wrote:
  Actually, it doesn't seem to work in all cases. I have to revise my fix.
  My current solution causes a ClastCastException inside Batik.
 
  On 21.11.2008 17:10:29 Jeremias Maerki wrote:
   Ok, you can now use SVG 1.2 in FOP Trunk:
   http://svn.apache.org/viewvc?rev=719616view=rev
  
 snip/



 Jeremias Maerki


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




Re: Embedding/merging external PDF files with XSL-FO

2008-11-11 Thread Sebastien
On Tue, Nov 11, 2008 at 8:54 AM, Jeremias Maerki [EMAIL PROTECTED] wrote:
 Sebastien,

 looks like you've missed a great resource for Apache FOP: the mailing
 list archive!

 For example: http://fop-users.markmail.org/search/?q=pdf%20images
 Searching for PDF and images reveals the PDF image extension I wrote.
 See also: http://www.jeremias-maerki.ch/development/fop/index.html


My apologies. I searched google and the archives, but i just wasn't
looking for the right thing obviously.
Anyways, thanks a lot for your answer.
Your help is very much appreciated and your work is truly awesome, thanks again.

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



Embedding/merging external PDF files with XSL-FO

2008-11-10 Thread Sebastien
Hi !
I have my main XML file with all the data coming from my application
and i generate the PDF with FOP without any trouble.
But I have third-party files, most of them in PDF format, which I
have to import into the final PDF file. For images, I can use
fo:external-graphic, but for PDF, i'm stuck for now.
I thought it wasn't possible with XSL-FO to embed PDF, until i found this:
 - fox:external-document
(http://xmlgraphics.apache.org/fop/0.95/extensions.html#external-document)
which seems to support PDF as well as TIFF
 - hope for the future : # add  Added generic structures to the PDF
library in order to support PDF file in fo:external-graphic later.
Committed by JM.
(http://xmlgraphics.apache.org/fop/changes.html#Changes+to+Renderers+(Output+Formats)-N1040C)

I tried both (fox:external-document and fo:external-graphic) but fop
fails for both with this message:
Reason: org.apache.xmlgraphics.image.loader.ImageException: No
ImagePreloader found for...
I'm using FOP 0.95 but i tried with the trunk's revision 712855 too.

I didn't really expect them to work as they seem to be work in
progress, but i was wondering whether there will be a chance to have
the capability to embed PDF with fop and xslfo anytime soon ?
Otherwise, how can i proceed to achieve what i want ?
 -Using an external program to merge pdf is not excluded but will be a
last resort solution as these external documents might not be always
appended or prepended to the final PDF but, instead, imported in the
middle of it, making the merge a real pain...
 -Asking my users to export their documents in JPG/PNG/TIFF makes
little sense when it comes to text document...
 -Converting all the PDF files into images seems to be a good
compromise but is a little bit hackish...
I would really love to do it in a full XML way (ie. with xslfo)

Here is a similar (short) discussion that happened a while ago:
http://markmail.org/message/d42zsuppvbzldkbm

Thanks in advance for your help.

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



Re: Image overflow in FOP

2008-11-05 Thread Sebastien
Thank you for your answer !

 Here's what I would do: Enable the i-f-o behaviour as in your first
 screenshot, then remove all keeps. That should avoid the overflow. Then
 add keep-with-next or keep-together one step after the other. I'm pretty
 sure that you've just overdone the keeps. Please note that
 keep-*=always doesn't allow FOP to break the content appart.

I removed all the keeps in my entire document (i searched in the .fo
output to be sure) but this didn't solve the problem unfortunately :(

Actually, i even put some break-before (and even break-after for...
the fun ?) everywhere in the encapsulating block hierarchy to force
the page break ! But, these two didn't work either whereas they have
worked in my previous test ! (i decided to drop this issue for a while
because i thought i would be able to hack it easily later...)

And that made me think of something i changed between my old test and now:
1) i ran into memory trouble before because the whole PDF was a unique
page-sequence, so i decided to divide it into multiple page-sequences.
It solved my memory problem and the style was more elegant. So i tried
reverting theses changes having one single page-sequence again... no
luck, still the overflow.
2) i needed a watermark on some of my pages (something like top
secret stuff) and i chose an XML solution again by using SVG. It
was more convenient because i was able to rotate the text and repeat
it as much as i wanted. The issue was to render it as a watermark
ie. all over the page and behind the content. I chose to use a
block-container to encapsulate all the item, including the map (an
item is Cheminée DALKIA for instance, it has several fields entitled
in green boxes and eventually a map, as you can see in the
screenshots) and i attached the watermark.svg as its background-image.
This worked great, and was much more elegant than the other solutions
i saw about watermarks. Same test as before: i removed the
block-container and... it worked 

I then re-added the keep-with-next between the green boxes and the map
and everything is now working very well. I just have to think about
another solution for the watermark, which really is a less important
issue than the one you helped me solve.

 Looking at your layout you'd probably have a keep-with-next on the green
 bar to keep the bar with the following image. But it (probably) makes no
 sense to glue the green bars together.

That's correct ;)


Well, thank you so much for you help. Even if the keeps were not the
direct cause of the problem, i did abuse of them a little so i cleaned
up my document. More important, it put me on the tracks to find out
the solution.
If you still have time to answer or some nice doc to point me to, I'd
like to know how block-container works, why it screwed the
page-breaking and how/when to use it. I think I didn't fully
understand the W3C spec about it.

Cheers !

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



Re: Image overflow in FOP

2008-11-05 Thread Sebastien
 Without seeing your FO to fully understand what you're doing it is a bit
 difficult to offer further suggestions. Usually, watermarks are best
 painted using block-containers (absolute-position=fixed) inside the
 region-before. Or you can use the background-image property on the
 region-body.

I needed conditional watermarking, so i managed to work this out with
the xsl-region-before. Thanks ;)

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



RE : FOP 0.92 Beta : Performance related question

2006-05-15 Thread Foucault, Sebastien
Title: RE : FOP 0.92 Beta : Performance related question





Hello,


Have a look at JasperReports, Birt and iText to check if they fit your needs.


Regards
--
Sébastien FOUCAULT






-Message d'origine-
De : Singhal, Ramneek (Exchange) [mailto:[EMAIL PROTECTED]] 
Envoyé : lundi 15 mai 2006 22:42
À : fop-users@xmlgraphics.apache.org
Objet : RE: FOP 0.92 Beta : Performance related question



Thanks J for your reply. 


Actually my reports are dynamic in nature which means that until I get
the dataset I do not know how many columns to show in report, what is
the width of each column, which column will be placed at which position
etc. user has the ability to add, remove, change column width, its
position in report. So its not fixed and hence can not be templatized.


If there's any tool which can suffice these requirments, like any java
API to generate PDF, or any template based product which can accommodate
dymanic column configuration?


I will highly appreciate any response.



-Original Message-
From: J.Pietschmann [mailto:[EMAIL PROTECTED]] 
Sent: Monday, May 15, 2006 3:28 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: FOP 0.92 Beta : Performance related question


Singhal, Ramneek (Exchange) wrote:
 I did tests on a
 2CPU(3.6GHz) linux machine with hyper threading on. I tried simulating


 generation of 100 reports with 4 concurrent threads at a time and the 
 best output which I could achieve was 6.5 pages/sec.


This sounds about right.


 1. is this the kind of performance we except or there is some problem 
 with the test results? Can I improve upon this performance by 
 optimising FO or hardware or anything? I have hardware infrastructure 
 to scale to 4 2CPU linux boxes. But even with those number of boxes, I


 cannot get the desired output at current level of performance.


It would be interesting to compare to a similar Windows box, in the past
JVMs on Linux were notorious for having inferior JITC optimizations.


I also think that for large reports, memory tuning should have more of
an effect than higher powered CPUs, or hyper threading. I also suspect
that for large reports, memory access is the bottleneck because of the
large volume of working data, which has probably bad locality (thwarts
caching). Therefore I wouldn't be surprised if FOP performance scales
rather sublinear both in CPU freq and number of CPUs. Of course, that's
just some sort of educated guess; running a professional profiler may
uncover something completely different.


Having said this, you should also know that FOP isn't yet tuned for
performance; standard conformance and a reasonably modular design still
have preference. The current line and page breaking algorithm will also
always be a memory hog. An architecture which will allow plugging in
alternative algorithms which are for example faster on average but give
less impressive results has been considered, but put off until after FOP
is feature complete.


 2. is FOP right approch for generating large amount of PDF reports in 
 a batch process? If its not can you suggest some other approach or 
 tools to do the job?


If the reports are mainly tables, and the number of rows per page is
easily predictable (preferably the same on every page due to fixed data
size), using XSLFO is probably overkill. A simple template language
combined with a text-to-PDF converter may be sufficient.
XSLFO is a good tool if computing line breaks becomes an issue, and a
professional layout with variable width fonts hyphenation and other such
things is relevant.


J.Pietschmann


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





**
Please be aware that, notwithstanding the fact that the person sending
this communication has an address in Bear Stearns' e-mail system, this
person is not an employee, agent or representative of Bear Stearns.
Accordingly, this person has no power or authority to represent, make
any recommendation, solicitation, offer or statements or disclose
information on behalf of or in any way bind Bear Stearns or any of its
affiliates.
**


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





PDF Text areas

2006-05-12 Thread Foucault, Sebastien
Title: PDF Text areas





Hello,


Here is the complex problem I have to deal with.


A few month ago, I encountered the well-know performance issue due to forward references when using fo:page-number-citation to include in document footers the number of pages of the generated documents.

To cope with this issue, we recently changed the way to handle that feature. For that, we simply replaced the fo:page-number-citation by a text marker included in an fo:block (fo:block¤/fo:block) and post-processed the PDF using iText to substitute the ¤ character by the real number of pages.

It works perfeclty except for following aspect. Because the length of the marker and the length of the substituted string are not the same, in some situation, the length increase generates an offset of text areas located after the marker (in another fo:block).

The precise situation in which the problem occurs is the following :


table
 ...
 table-row
  ...
  table-cellfo:block¤/fo:block/table-cell
  ...
  table-cellfo:blockAnother cell/fo:block/table-cell
 /table-row
 ...
/table


It seems that the PDF contains a single area with all the elements of the row (I'm not familiar at all with the internals of the PDF format).

My question is the following : is there a way to force FOP to generate two distinct areas in the PDF making the substitution impacts of the length increase neutral toward other cells position of the same row.

Thank's in advance


PS : I use FOP 0.20.5



Regards
--
Sébastien FOUCAULT







RE : page-sequence and memory useage

2006-05-12 Thread Foucault, Sebastien
Title: RE : page-sequence and memory useage





Hello,


We encountered similar issues a long time ago.
Because of the irregular structure of the page breaks, we used an approach based on SAX filters (quite complex) located just before the FOP ContentHandler aiming at transforming page-break into page sequences.

The SAX filter approach allowed us to keep low memory consumption.


eg.


doc
page-sequence
 Data set 1
 break/
 Data set 2
 break/
 Data set 3
/page-sequence
/doc


transformed by SAX filters into :


doc
 page-sequence
 Data set 1
 /page-sequence
 page-sequence
 Data set 2
 /page-sequence
 page-sequence
 Data set 3
 /page-sequence
/doc



Regards
--
Sébastien FOUCAULT







-Message d'origine-
De : Pascal Sancho [mailto:[EMAIL PROTECTED]] 
Envoyé : vendredi 12 mai 2006 12:00
À : fop-users@xmlgraphics.apache.org
Objet : RE: page-sequence and memory useage



 -Original Message-
 From: Giorgio [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
 
  I do not agree with these values.
  I use FOP dayly to generate 100-250 pages documents with 
 forward  references (TOC at beginning) without memory 
 problem (with FOP 0.20.5).
 
  We writes documents that can be easily splitted in short 
 page-sequences  (1-6 pages).
 
 This is a very good news for me, Pascal. My question is, how 
 do you split your document? I mean, I think page-squence tag 
 is made to solve the splitting document in pages problem 
 but if there are better ways that doesn't consume large 
 amount of memory I will be very glad to learn these.
 BTW, there are no examples in the FOP documentation on that task.


We use a writting method that allows to cut heavy documents in short
sequences.
So, each sequence is titled and we can insert a page-break before title.


It's especially an analytic approach, not a physical process, that
consists in structuring and mapping the information.


Since it is out of topic in this list, you can directly email me
[EMAIL PROTECTED] for more information.


Pascal


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





0.9.X Status

2006-01-02 Thread Foucault, Sebastien
Dear all,

Just a few questions about the new version of FOP.

Performances


The following page http://xmlgraphics.apache.org/fop/0.91/running.html reads
:

FOP can consume quite a bit of memory, even though this has been
continually improved. This is partly inherent to the formatting process and
partly caused by implementation choices. All FO processors currently on the
market have memory problems with certain layouts. 

and then

One of FOP's stated design goals is to be able to process input of
arbitrary size. Addressing this goal is one of the prime motivations behind
the FOP Redesign. 

What is new version status toward all these performance hints ?

- Forward references (Page X/*** Y ***)
- Large images
- Long page sequences

Extensions
--

Is an extension mechanism planned in the development roadmap. I perfectly
understand that APIs and extension mechanisms exposing the internals of a
product are the kind of things which cannot be implemented in the early
releases. However, planning to upgrade an application based on a customized
FOP 0.20.5, I'd like to know whether such features are on the verge on being
implemented or not.

Thank's in advance
-- 
Sébastien



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



TR : Performance issues using Fo:marker

2005-09-28 Thread Foucault, Sebastien
Hello,

The problem can be easliy reproduced using the examples/fo/markers/hide.fo
samples with tiny modifications :

- remove the fo:page-number-citation/ element to ensure that the OOM does
not come from the forward references
- remove the id=end-of-document attribute
- duplicate many times the main page-sequence

I noticed that all the markers encountered within the document are stored in
a list at the document scope in the StreamRenderer (documentMarkers member).
This is the reason for high memory consumption.

In my case, I overcame the problem by storing only one instance of marker
per marker class name because I use a retrieve-position for the
retrieve-marker element compatible with such a behaviour
(last-starting.).

   //
   // New method 
   private void addDocumentMarker( Marker _oMarker ) {
   for ( int i = 0 ; i  documentMarkers.size() ; i++ ) {
  Marker oMarker = (Marker) documentMarkers.get(i); 
  if (
oMarker.getMarkerClassName().equals(_oMarker.getMarkerClassName()) ) {
 documentMarkers.set(i,oMarker);
 return;
  }
   }
   
   documentMarkers.add(_oMarker);
}

public synchronized void queuePage(Page page)
throws FOPException, IOException {

// ...
for (int i=0;imarkers.size();i++) {
Marker marker = (Marker)markers.get(i);
marker.releaseRegistryArea();
currentPageSequenceMarkers.add(marker);

// documentMarkers.add(marker);
addDocumentMarker(marker);
}
}




Regards
--
Sébastien FOUCAULT


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



Performance isseus Fo:marker

2005-09-26 Thread Foucault, Sebastien
Hello,

I'm running FOP 0.20.5 under Win32 and I have performance issues processing
XSL documents containing fo:marker / fo:retrieve-marker tags.
Do fo:marker/ and fo:retrieve-marker/ elements generate high memory
consumption as long page sequences and fo:page-citation/ elements do ?

NB1 : My document is splitted into tiny page sequences
NB2 : My document does not content any fo:page-number-citation
NB3 : When I remove the fo:marker/ / fo:retrieve-marker/ the memory
consumption decreases.

!-- This kind of page sequence is repeted many times --
fo:page-sequence

   !-- Static region containing a retrieve-marker --
   fo:static-content
  fo:block
 ...
fo:table-cell
   fo:block white-space-collapse=false
  fo:retrieve-marker 
 retrieve-class-name=StrId
 retrieve-position=last-starting-within-page 
 retrieve-boundary=document/  
  /fo:block
   /fo:block
 /fo:table-cell
 ...
  /fo:block
   /fo:static-content


   !-- Flow containing several markers --
   fo:flow flow-name=xsl-region-body
  
  fo:block empty=true
 fo:marker marker-class-name=StrId
fo:blockCoucou/fo:block
 /fo:marker
   /fo:block
   fo:block break-before=page/
   ...
   ...
   fo:block empty=true
  fo:marker marker-class-name=StrId
 fo:blockCoucou/fo:block
  /fo:marker
   /fo:block
   ...
   ...
/fo:page-sequence


Regards
--
Sébastien FOUCAULT



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