You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by gm...@apache.org on 2004/01/22 23:40:51 UTC

cvs commit: xml-fop/src/java/org/apache/fop/svg PDFGraphics2D.java PDFImageElementBridge.java

gmazza      2004/01/22 14:40:51

  Modified:    .        build.xml
               src/java/org/apache/fop/svg PDFGraphics2D.java
                        PDFImageElementBridge.java
  Log:
  Applied Thomas DeWeese's latest patch for the PDF transcoder.
  
  Revision  Changes    Path
  1.101     +4 -1      xml-fop/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-fop/build.xml,v
  retrieving revision 1.100
  retrieving revision 1.101
  diff -u -r1.100 -r1.101
  --- build.xml	22 Jan 2004 09:06:05 -0000	1.100
  +++ build.xml	22 Jan 2004 22:40:51 -0000	1.101
  @@ -520,7 +520,10 @@
           <!--include name="org/apache/fop/layout/Font*.class"/-->
           <include name="org/apache/fop/image/FopImag*.class"/>
           <include name="org/apache/fop/image/Jpeg*"/>
  +        <include name="org/apache/fop/image/EPS*"/>
           <include name="org/apache/fop/image/Abstract*"/>
  +        <include name="org/apache/fop/image/analyser/*.class"/>
  +        <include name="org/apache/fop/util/CMYKColorSpace*.class"/>
           <include name="org/apache/fop/util/StreamUtilities.class"/>
           <include name="org/apache/fop/util/*OutputStream.class"/>
           <include name="org/apache/fop/util/Finalizable.class"/>
  @@ -580,7 +583,7 @@
         <fileset dir="${build.dest}">
           <patternset refid="transcoder-classes"/>
         </fileset>
  -      <fileset dir="${build.dir}/transcoder-dependencies"/>
  +      <fileset dir="${transcoder-deps}"/>
         <manifest>
           <attribute name="Implementation-Title" value="${fop-transcoder.name}"/>
           <attribute name="Implementation-Version" value="${fop-transcoder.version}"/>
  
  
  
  1.13      +13 -3     xml-fop/src/java/org/apache/fop/svg/PDFGraphics2D.java
  
  Index: PDFGraphics2D.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/svg/PDFGraphics2D.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- PDFGraphics2D.java	12 Dec 2003 22:37:39 -0000	1.12
  +++ PDFGraphics2D.java	22 Jan 2004 22:40:51 -0000	1.13
  @@ -152,6 +152,12 @@
       protected int baseLevel = 0;
   
       /**
  +     * The count of JPEG images added to document so they recieve
  +     * unique keys.
  +     */
  +    protected int jpegCount = 0;
  +
  +    /**
        * The current font information.
        */
       protected Document fontInfo;
  @@ -340,9 +346,13 @@
        * @param width the width to draw the image
        * @param height the height to draw the image
        */
  -    public void addJpegImage(JpegImage jpeg, float x, float y, float width, float height) {
  -        FopPDFImage fopimage = new FopPDFImage(jpeg, "");
  -        int xObjectNum = this.pdfDoc.addImage(resourceContext, fopimage).getXNumber();
  +    public void addJpegImage(JpegImage jpeg, float x, float y, 
  +                             float width, float height) {
  +        String key = "__AddJPEG_"+jpegCount;
  +        jpegCount++;
  +        FopPDFImage fopimage = new FopPDFImage(jpeg, key);
  +        int xObjectNum = this.pdfDoc.addImage(resourceContext, 
  +                                              fopimage).getXNumber();
   
           AffineTransform at = getTransform();
           double[] matrix = new double[6];
  
  
  
  1.5       +1 -1      xml-fop/src/java/org/apache/fop/svg/PDFImageElementBridge.java
  
  Index: PDFImageElementBridge.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/svg/PDFImageElementBridge.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PDFImageElementBridge.java	3 Jan 2004 03:25:02 -0000	1.4
  +++ PDFImageElementBridge.java	22 Jan 2004 22:40:51 -0000	1.5
  @@ -97,6 +97,7 @@
                   (purl.toString(), purl.openStream(), null);
               if (ii.mimeType.toLowerCase() == "image/jpeg") {
                   JpegImage jpeg = new JpegImage(ii);
  +                jpeg.load(FopImage.ORIGINAL_DATA, null);
                   PDFJpegNode node = new PDFJpegNode(jpeg, origGN);
   
                   Rectangle2D imgBounds = getImageBounds(ctx, e);
  @@ -154,7 +155,6 @@
           public void primitivePaint(Graphics2D g2d) {
               if (g2d instanceof PDFGraphics2D) {
                   PDFGraphics2D pdfg = (PDFGraphics2D) g2d;
  -                pdfg.setTransform(getTransform());
                   float x = 0;
                   float y = 0;
                   try {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org