1 51 package org.apache.fop.image; 52 53 import java.net.URL ; 55 56 import org.apache.fop.messaging.*; 58 import org.apache.fop.image.analyser.ImageReader; 59 import org.apache.fop.image.analyser.EPSReader; 60 61 65 public class EPSImage extends AbstractFopImage { 66 private String docName; 67 private int[] bbox; 68 69 private byte[] epsImage = null; 70 private EPSReader epsReader = null; 71 72 75 private void init(URL href) { 76 bbox = new int[4]; 77 bbox[0] = 0; 78 bbox[1] = 0; 79 bbox[2] = 0; 80 bbox[3] = 0; 81 82 docName = href.toString(); 83 } 84 85 88 public String getDocName() { 89 return docName; 90 } 91 92 95 public int[] getBBox() { 96 return bbox; 97 } 98 99 public EPSImage(URL href) throws FopImageException { 100 super(href); 101 init(href); 102 } 103 104 public EPSImage(URL href, 105 ImageReader imgReader) throws FopImageException { 106 super(href, imgReader); 107 init(href); 108 if (imgReader instanceof EPSReader) { 109 EPSReader eimgReader = (EPSReader)imgReader; 110 epsReader = eimgReader; 111 epsImage = eimgReader.getEpsFile(); 112 m_bitmaps = epsImage; 113 bbox = eimgReader.getBBox(); 114 } 115 } 116 117 protected void loadImage() throws FopImageException { 118 } 120 121 public byte[] getEPSImage() throws FopImageException { 122 if (epsImage == null) 123 MessageHandler.errorln("ERROR LOADING EXTERNAL EPS"); 124 return epsImage; 125 } 126 127 } 128 | Popular Tags |