/// <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; }
public PdfPageTreeNode GetPageTreeNode() { PdfPageTreeNode node = new PdfPageTreeNode(); node.Ref = NextRef; node.Add("Type", "/Pages"); node.Add("Kids", "[ ]"); node.Add("Count", "0"); return node; }