Exemplo n.º 1
0
        /// <summary>
        /// Constructor which lets the caller specify default page size, orientation and margins.
        /// </summary>
        /// <param name="defaultPageSize">Default page size.</param>
        /// <param name="defaultOrientation">Default page orientation.</param>
        /// <param name="defaultHorizontalMarginProportion">Default left and right margin proportions.</param>
        /// <param name="defaultVerticalMarginProportion">Default top and bottom margin proportions.</param>
        public PdfDocument(PhysicalPageSize defaultPageSize, PageOrientation defaultOrientation, double defaultHorizontalMarginProportion, double defaultVerticalMarginProportion)
        {
            _pageRoot = new PdfPageTreeNode(null, _xrefTable.ClaimSlot());
            _bodyObjects.Add(_pageRoot);
            _root = new PdfCatalogue(_pageRoot, _xrefTable.ClaimSlot());
            _bodyObjects.Add(_root);

            DefaultPhysicalPageSize           = defaultPageSize;
            DefaultPageOrientation            = defaultOrientation;
            DefaultHorizontalMarginProportion = defaultHorizontalMarginProportion;
            DefaultVerticalMarginProportion   = defaultVerticalMarginProportion;
        }
Exemplo n.º 2
0
        public PdfPageTreeNode GetPageTreeNode()
        {
            PdfPageTreeNode node = new PdfPageTreeNode();
            node.Ref = NextRef;
            node.Add("Type", "/Pages");
            node.Add("Kids", "[ ]");
            node.Add("Count", "0");

            return node;
        }