//============================================================================ //Gios Pdf.NET - A library for exporting Pdf Documents in C# //Copyright (C) 2005 Paolo Gios - www.paologios.com // //This library is free software; you can redistribute it and/or //modify it under the terms of the GNU Lesser General Public //License as published by the Free Software Foundation; either //version 2.1 of the License, or (at your option) any later version. // //This library is distributed in the hope that it will be useful, //but WITHOUT ANY WARRANTY; without even the implied warranty of //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //Lesser General Public License for more details. // //You should have received a copy of the GNU Lesser General Public //License along with this library; if not, write to the Free Software //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //============================================================================= using System; using System.Drawing; using System.IO; using System.Text; namespace HH.WMS.Utils.Gios.Pdf { /// /// a 72dpi jpeg based Image for a PdfPage /// public class PdfImage : PdfObject { internal MemoryStream ImageStream; string file; internal Bitmap bmp; /// /// gets the height of the loaded picture /// public int Height { get { return bmp.Height; } } /// /// gets the width of the loaded picture /// public int Width { get { return bmp.Width; } } internal PdfImage(int id,string file) { this.id=id; this.file=file; ImageStream=new MemoryStream(); try { this.bmp=new Bitmap(file); } catch { throw new Exception("Error Loading Image File"); } } internal int StreamGifWrite(System.IO.Stream stream) { FileStream fs; try { fs = File.OpenRead(this.file); } catch {throw new Exception("Can't open image file");} byte[] data = new byte[fs.Length]; System.Drawing.Image i=Image.FromFile(file); string text1=""; text1+=this.HeadObj; text1+="<>\n"; text1+="<