Exemplo n.º 1
0
        internal Document(
            File context
            ) : base(
                context,
                new PdfDictionary(
                    new PdfName[1] { PdfName.Type },
                    new PdfDirectObject[1] { PdfName.Catalog }
                    ) // Document catalog [PDF:1.6:3.6.1].
                )
        {
            configuration = new Config(this);

            /*
             * NOTE: Here it is just a minimal initialization;
             * any further customization is upon client's responsibility.
             */
            // Link the document to the file!
            context.Trailer[PdfName.Root] = BaseObject; // Attaches the catalog reference to the file trailer.

            // Initialize the pages collection (page-tree root node)!
            this.Pages = new Pages(this); // NOTE: The page-tree root node is required [PDF:1.6:3.6.1].

            // Default page size.
            PageSize = PageFormat.GetSize();

            // Default resources collection.
            Resources = new Resources(this);
        }
Exemplo n.º 2
0
        internal Document(
            File context
            ) : base(
                context,
                new PdfDictionary(
                    new PdfName[1] { PdfName.Type },
                    new PdfDirectObject[1] { PdfName.Catalog }
                    )
                )
        {
            configuration = new DocumentConfiguration(this);

            // Attach the document catalog to the file trailer!
            context.Trailer[PdfName.Root] = BaseObject;

            // Pages collection.
            this.Pages = new Pages(this);

            // Default page size.
            PageSize = PageFormat.GetSize();

            // Default resources collection.
            Resources = new Resources(this);
        }