示例#1
0
        /// <summary>
        /// Constructor
        /// </summary>
        internal PdfGraphics(PdfPage page, PdfDocument doc)
        {
            this.page = page;
            stream    = new PdfStream();
            PdfDocument.RegisterForOutput(stream);
            page.RegisterContentStream(stream.IndirectReference);

            // Add the transform matrix for the graphics state
        }
示例#2
0
 private void Init()
 {
     registeredObject = new ArrayList();                                 // Create container before instantiating other objects
     ids     = 0;                                                        // We start at zero
     header  = new Header(1, 5);                                         // Currently only supported type (PDF 1.5)
     catalog = new Catalog();
     trailer = new Trailer();
     PdfDocument.RegisterForOutput(catalog);                     // Register the catalog
 }
示例#3
0
        private PdfPage In_CreatePage(float height, float width, PdfPageOrientation orientation)
        {
            if (orientation == PdfPageOrientation.Landscape)
            {
                float temp = width;
                width  = height;
                height = width;
            }

            PdfPage newPage = new PdfPage(catalog.Pages, this, height, width);

            PdfDocument.RegisterForOutput(newPage);
            catalog.Pages.RegisterPage(newPage);

            return(newPage);
        }
示例#4
0
        public void DrawImage(Image image, Point start)
        {
            this.ConvertToUserSpace(ref start);

            // Create the image stream and register it for output
            PdfInlineImage img = new PdfInlineImage(image);

            PdfDocument.RegisterForOutput(img);
            page.RegisterContentStream(img.IndirectReference);

            // Create the reference stream and image diplay stuff
//			PdfStream imageStream = new PdfStream();
//			PdfDocument.RegisterForOutput(imageStream);
//			page.RegisterContentStream(imageStream.IndirectReference);
//
//			imageStream.WriteToSream("q");
//			imageStream.WriteToSream("0 0 0 0 " +
//				start.X.ToString() + " " +
//				start.Y.ToString() + " cm"
//				);
//			imageStream.WriteToSream("/I1 Do");
//			imageStream.WriteToSream("Q");
        }
示例#5
0
 public Catalog()
 {
     this.Add(type, new PdfName("Catalog"));
     PdfDocument.RegisterForOutput(pagesObj);                                            // Register the pages object for output
     this.Add(pages, pagesObj.IndirectReference);
 }