u3d pdf file

2020-09-23 Thread jfrm.mau...@gmail.com

Hi,

I am trying to include a pdf file containing a 3d drawing inside a pdf 
file using fop 2.3 and fop-images-pdf 2.3. However the graphic included 
is outside of the bound of the containing block (see result.pdf page 4).

Could you please tell what is wrong here ?

For information everything is fine if I incorporate a 'normal' pdf 
without 3d model.


The process I used is the following:

- including the pdf with
  
   block-progression-dimension="100mm" content-width="scale-to-fit" 
scaling="uniform" />

  
- for information the u3d.pdf file containing a u3d graphic is build 
from a u3d file using the following java code with itext 5.5

    public static void writePdf(String u3dFileUri, OutputStream out) {
    Dimension dimension = new Dimension(100,100);
    Rectangle pageSize = new Rectangle(dimension.width, 
dimension.height);

    Document doc = new Document();
    try {
    PdfWriter wr = PdfWriter.getInstance(doc, out);
    doc.open();
    String script = getScript();
    PdfStream oni = new 
PdfStream(PdfEncodings.convertToBytes(script, null));

    oni.flateCompress();
    PdfIndirectReference initScriptRef = 
wr.addToBody(oni).getIndirectReference();
    ArrayList viewList = new 
ArrayList(1);
    PdfDictionary viewDict = new PdfDictionary(new 
PdfName(PDF_NAME_3DVIEW));

    viewDict.put(new PdfName(PDF_NAME_MS), new PdfString("M"));
    float[] T1 = new float[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0 };

    viewDict.put(new PdfName("C2W"), new PdfArray(T1));
    String cameraName = "Test Camera";
    viewDict.put(new PdfName(PDF_NAME_XN), new 
PdfString(cameraName));
    PdfIndirectReference ref = 
wr.addToBody(viewDict).getIndirectReference();

    viewList.add(ref);
    File u3d = FileProc.newFile(u3dFileUri);
    PdfStream stream = new PdfStream(new FileInputStream(u3d), wr);
    stream.put(new PdfName("OnInstantiate"), initScriptRef);
    stream.put(PdfName.TYPE, new PdfName(PDF_NAME_3D));
    stream.put(PdfName.SUBTYPE, new PdfName(PDF_NAME_U3D));
    stream.flateCompress();
    PdfIndirectReference u3dStreamRef = 
wr.addToBody(stream).getIndirectReference();

    stream.writeLength();
    PdfDictionary activationDict = new PdfDictionary();
    activationDict.put(PdfName.A, new PdfName("PO"));
    activationDict.put(new PdfName("DIS"), PdfName.I);
    float scale = 0.5f;
    float width = scale * (pageSize.getRight() - 
pageSize.getLeft());
    float height = scale * (pageSize.getTop() - 
pageSize.getBottom());
    PdfAppearance ap = PdfAppearance.createAppearance(wr, 
width, height);

    ap.setBoundingBox(pageSize);
    PdfAnnotation annot = new PdfAnnotation(wr, pageSize);
    annot.put(PdfName.CONTENTS, new PdfString("3D Model"));
    annot.put(PdfName.SUBTYPE, new PdfName(PDF_NAME_3D));
    annot.put(PdfName.TYPE, PdfName.ANNOT);
    annot.put(new PdfName(PDF_NAME_3DD), u3dStreamRef);
    PdfBoolean value3DI = showInventory ? PDFTRUE : PDFFALSE;
    annot.put(new PdfName("3DI"), value3DI);
    annot.setAppearance(PdfAnnotation.APPEARANCE_NORMAL, ap);
    annot.put(new PdfName("3DA"), activationDict);
    annot.setPage(1);
    wr.addAnnotation(annot);
    doc.close();
    } catch (IOException e) {
    e.printStackTrace();
    } catch (DocumentException de) {
    de.printStackTrace();
    }
    }



pdf files :
u3d.pdf (7,0 
Ko)WeTransferhttps://we.tl/t-5fBBo0McMz 
result.pdf (4,1 
Mo)WeTransferhttps://we.tl/t-kp7wlyiptl 
Mozilla Thunderbird  permet de partager 
facilement des fichiers volumineux.


Regards

--
Jean-François MAUREL
PIMECA
http://www.pimeca.com



binCYii2JAHel.bin
Description: Binary data


binKvN9VEInO_.bin
Description: Binary data

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

Re: build error in fop-trunk

2020-03-18 Thread jfrm.mau...@gmail.com



Hi Simon,

Thank you for your suggestion.

Le 18/03/2020 à 16:33, Simon Steiner a écrit :

mvn clean install -DskipTests

This one works however as I am trying to learn I would prefer a clean build.

Regards

--
Jean-François MAUREL
PIMECA
http://www.pimeca.com


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



Re: build error in fop-trunk

2020-03-18 Thread jfrm.mau...@gmail.com



Hi Chris,

Thank you for your answer.

Le 18/03/2020 à 15:18, Chris Bowditch a écrit :

Can you share the errors you are seeing?


Sure.

I investigated a little bit more:
1- an event-model.xml was missing because ANT_HOME was not set on my 
computer if I am not mistaken.

A comment in the README file could help future users may be.
2- I suspect a problem of 'end of line' (I build on Windows 10 with java 
8) in test org.apache.fop.accessibility.fo.FO2StructureTreeConverterTestCase
3- I pasted the full report from maven build below (don't if attachment 
are allowed).


Also don't forget FOP supports older Java versions so might need to 
build with Java 7

 Thanks for the tip.

Regards


===
MAVEN BUILD REPORT
===
[INFO] Scanning for projects...
[INFO] 


[INFO] Reactor Build Order:
[INFO]
[INFO] Apache FOP 
Parent  [pom]
[INFO] Apache FOP 
Utilities   [jar]
[INFO] Apache FOP 
Events  [jar]
[INFO] Apache FOP 
Core    [jar]
[INFO] Apache FOP 
All-In-One  [jar]
[INFO] Apache FOP 
Sandbox [jar]
[INFO] Apache FOP 
Servlet [war]
[INFO] Apache FOP 
Transcoder  [jar]
[INFO] Apache FOP Transcoder 
All-In-One   [jar]

[INFO]
[INFO] -< org.apache.xmlgraphics:fop-parent 
>--
[INFO] Building Apache FOP Parent 
2.5.0-SNAPSHOT  [1/9]
[INFO] [ pom 
]-

[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ fop-parent ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ 
fop-parent ---
[INFO] Installing D:\git\xmlgraphics-fop\pom.xml to 
C:\Users\mlamo\.m2\repository\org\apache\xmlgraphics\fop-parent\2.5.0-SNAPSHOT\fop-parent-2.5.0-SNAPSHOT.pom

[INFO]
[INFO] --< org.apache.xmlgraphics:fop-util 
>---
[INFO] Building Apache FOP Utilities 
2.5.0-SNAPSHOT   [2/9]
[INFO] [ jar 
]-

[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ fop-util ---
[INFO] Deleting D:\git\xmlgraphics-fop\fop-util\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
fop-util ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
D:\git\xmlgraphics-fop\fop-util\src\main\resources

[INFO] Copying 2 resources to META-INF
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ 
fop-util ---

[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to 
D:\git\xmlgraphics-fop\fop-util\target\classes
[WARNING] 
/D:/git/xmlgraphics-fop/fop-util/src/main/java/org/apache/fop/util/XMLResourceBundle.java: 
D:\git\xmlgraphics-fop\fop-util\src\main\java\org\apache\fop\util\XMLResourceBundle.java 
uses unchecked or unsafe operations.
[WARNING] 
/D:/git/xmlgraphics-fop/fop-util/src/main/java/org/apache/fop/util/XMLResourceBundle.java: 
Recompile with -Xlint:unchecked for details.

[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources 
(default-testResources) @ fop-util ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
D:\git\xmlgraphics-fop\fop-util\src\test\resources

[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ 
fop-util ---

[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ fop-util ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:3.1.1:jar (default-jar) @ fop-util ---
[INFO] Building jar: 
D:\git\xmlgraphics-fop\fop-util\target\fop-util-2.5.0-SNAPSHOT.jar

[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ fop-util ---
[INFO] Installing 
D:\git\xmlgraphics-fop\fop-util\target\fop-util-2.5.0-SNAPSHOT.jar to 
C:\Users\mlamo\.m2\repository\org\apache\xmlgraphics\fop-util\2.5.0-SNAPSHOT\fop-util-2.5.0-SNAPSHOT.jar
[INFO] Installing D:\git\xmlgraphics-fop\fop-util\pom.xml to 
C:\Users\mlamo\.m2\repository\org\apache\xmlgraphics\fop-util\2.5.0-SNAPSHOT\fop-util-2.5.0-SNAPSHOT.pom

[INFO]
[INFO] -< org.apache.xmlgraphics:fop-events 
>--
[INFO] Building Apache FOP Events 
2.5.0-SNAPSHOT  [3/9]
[INFO] [ jar 
]-

[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ fop-events ---
[INFO] Deleting D:\git\xmlgraphics-fop\fop-events\target
[INFO]
[INFO] --- 

build error in fop-trunk

2020-03-10 Thread jfrm.mau...@gmail.com

Hi,

I just cloned from git repository with:
git clone https://github.com/apache/xmlgraphics-fop.git

I build with:
mvn clean install

but the builds fails in the fop core task apparently from missing resources.

Am I doing something wrong to build fop ?

Regards

PS: I am on windows 10 if relevant

--
Jean-François MAUREL
PIMECA
http://www.pimeca.com


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



Hyphenation pattern Lincensing issues

2015-01-07 Thread jfrm.mau...@gmail.com

Hi,

I am using hyphenation pattern with FOP 1.1 from fop-hyph.jar downloaded 
from OFFO site for french language (fr).


Could you please tell me what are the actual licensing issues for this 
configuration ?


I could not find something specific for this case in fop site neither in 
offo site.


Regards

--
Jean-François MAUREL
PIMECA
http://www.pimeca.com


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



Re: Hyphenation pattern Lincensing issues

2015-01-07 Thread jfrm.mau...@gmail.com

Le 07/01/2015 20:07, Luis Bernardo a écrit :

Hi,

See if http://tug.org/tex-hyphen/#languages answers your question.  
You can also try to contact the authors of the pattern you are using 
or ask at tex-hyp...@tug.org.


Thanks a lot.

Regards

--
Jean-François MAUREL
PIMECA
http://www.pimeca.com


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



Re: Hyphenation pattern Lincensing issues

2015-01-07 Thread jfrm.mau...@gmail.com

Le 07/01/2015 16:38, Simon Steiner a écrit :

I updated the link, Latex project may know more about licensing for a specific 
file.


Thank you.

--
Jean-François MAUREL
PIMECA
http://www.pimeca.com


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



Re: Hyphenation pattern Lincensing issues

2015-01-07 Thread jfrm.mau...@gmail.com

Le 07/01/2015 14:58, Simon Steiner a écrit :

Hi,


 Many of the hyphenation files distributed with TeX and its offspring are licenced 
under the LaTeX Project Public License (LPPL), which prevents them from being distributed 
with Apache software.


Thank you for your answer.
I read that however I was not able to determine what was the particular 
issue for the french case.


The link: http://www.latex-project.org/lppl.html on FOP page seems to be 
broken.


Regards

--
Jean-François MAUREL
PIMECA
http://www.pimeca.com


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



Re: font family name with lower case

2014-07-19 Thread jfrm.mau...@gmail.com

Le 19/07/2014 15:19, Tor-Einar Jarnbjo a écrit :

Hi Tor-Einar Jarnbjo,

Thanks for your answer.

The XLS-FO specification does not mention if font names should be 
treated case insensitive, but refers to the CSS2 specification, which 
states that it is beyond the specification to define if font names are 
case sensitive or not (clever way to allow ambiguity).


The CSS3 specification states that font names are case insensitive.


Thank you for this detailed information.



Since the specification leaves it up to the implementation to do 
whatever it sees fit, FOP does at least not violate the specifications 
by requiring case sensitivity in the font names. Using a case 
insensitive font name matching (as required by CSS3) would of course 
raise new problems as well and not only be convenient. What if the 
font manager used by the rendering enige is case sensitive itself and 
allows a and A to be two different fonts? Which font should be 
picked if you refer to them as a or A in the font-family attribute?


I agree that a case sensitive recognition is more rigorous. As a user I 
would like a more detailed message when the font is not found.


The different behaviour between Fop and Batik is also confusing.

Regards

--
Jean-François MAUREL
PIMECA
http://www.pimeca.com


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