/// <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 }
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 }
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); }
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"); }
public Catalog() { this.Add(type, new PdfName("Catalog")); PdfDocument.RegisterForOutput(pagesObj); // Register the pages object for output this.Add(pages, pagesObj.IndirectReference); }