Example #1
0
 internal PdfPage(PdfDocument pdfDocument, PdfDocumentFormat PdfDocumentFormat)
     : base(pdfDocument)
 {
     this.PdfDocument.pageCount++;
     this.Images            = new ArrayList();
     this.PdfDocumentFormat = PdfDocumentFormat;
     this.PdfStream         = new PdfStream(this);
 }
		internal PdfPage(PdfDocument pdfDocument, PdfDocumentFormat PdfDocumentFormat)
            :base(pdfDocument)
		{
            this.PdfDocument.pageCount++;
            this.Images = new ArrayList();
			this.PdfDocumentFormat=PdfDocumentFormat;
			this.PdfStream=new PdfStream(this);
		}	
Example #3
0
 internal PdfDocument(PdfDocumentFormat DefaultPageFormat, string subject, string title, string author)
 {
     this.defaultPageFormat = DefaultPageFormat;
     this.PdfObjects        = new ArrayList();
     this.images            = new Hashtable();
     new PdfHeader(this, subject, title, author);
     new PdfCatalog(this);
     new PdfRoot(this);
 }
        internal PdfDocument(PdfDocumentFormat DefaultPageFormat, string subject, string title, string author)
		{
			this.defaultPageFormat=DefaultPageFormat;
            this.PdfObjects = new ArrayList();
            this.images = new Hashtable();
            new PdfHeader(this, subject, title, author);
            new PdfCatalog(this);
            new PdfRoot(this);
        }
Example #5
0
        public static MemoryStream ConvertImageToPDF(byte[] jpegStream)
        {
            System.Drawing.Image img = null;
            using (MemoryStream ms2 = new MemoryStream())
            {
                ms2.Write(jpegStream, 0, jpegStream.Length);
                img = System.Drawing.Image.FromStream(ms2);
            }

            float dpi = img.HorizontalResolution;

            float realw = (((float)(img.Width)) / img.HorizontalResolution);
            float realy = (((float)(img.Height)) / img.HorizontalResolution);

            PdfDocumentFormat format = PdfDocumentFormat.InInches(realw, realy);

            MemoryStream ms = new MemoryStream();
            PdfDocument  pd = new PdfDocument(format, "", "", "");
            PdfPage      pp = pd.NewPage();

            pp.Add(jpegStream, 0, 0, dpi);
            pd.Save(ms);
            return(ms);
        }
Example #6
0
 internal PdfPage NewPage(PdfDocumentFormat PdfDocumentFormat)
 {
     return(new PdfPage(this, PdfDocumentFormat));
 }
        internal PdfPage NewPage(PdfDocumentFormat PdfDocumentFormat)
		{
			return new PdfPage(this,PdfDocumentFormat);
        }