internal PdfPage(PdfPageTree parent, PdfSize size) { m_Size = size; m_Unit = m_Size.Unit; m_Parent = parent; m_Fonts = new List <PdfFont>(); m_Elements = new List <PdfElement>(); }
internal PdfPage(PdfPageTree parent, PdfSize size) { m_Size = size; m_Unit = m_Size.Unit; m_Parent = parent; m_Fonts = new List<PdfFont>(); m_Elements = new List<PdfElement>(); }
public PdfDocument() { m_Fonts = new List <PdfFont>(); m_Meta = new PdfMeta(); m_Info = new PdfInfo(); m_OutLines = new PdfOutlines(); m_Root = new PdfRoot(); m_PageTree = new PdfPageTree(); m_Trailer = new PdfTrailer(); m_ObjectRepository = new ObjectRepository(); m_ResourceRepository = new ResourceRepository(); m_Root.Info = m_Info; m_Root.Outlines = m_OutLines; m_Root.PageTree = m_PageTree; m_Trailer.Root = m_Root; m_PageSize = PdfPageSize.Default(); }
public PdfDocument() { m_Fonts = new List<PdfFont>(); m_Meta = new PdfMeta(); m_Info = new PdfInfo(); m_OutLines = new PdfOutlines(); m_Root = new PdfRoot(); m_PageTree = new PdfPageTree(); m_Trailer = new PdfTrailer(); m_ObjectRepository = new ObjectRepository(); m_ResourceRepository = new ResourceRepository(); m_Root.Info = m_Info; m_Root.Outlines = m_OutLines; m_Root.PageTree = m_PageTree; m_Trailer.Root = m_Root; m_PageSize = PdfPageSize.Default(); }
/// <summary> /// Writes PDF document page tree into file stream /// </summary> /// <param name="pageTree">PDF document page tree</param> internal void Write(PdfPageTree pageTree) { if (pageTree.Pages.Count == 0) throw new InvalidOperationException("PDF document has no pages"); var pages = string.Join(Constants.SPACE, pageTree.Pages.Select(p => p.GetReference())); writeBeginObject(pageTree.ObjectId); writeBeginDictionary(); writeDictionaryEntry("/Type", "/Pages"); writeDictionaryEntry("/Count", pageTree.Pages.Count); writeDictionaryEntry("/Kids", ARRAY_PDF_FORMAT.Args(pages)); writeEndDictionary(); writeEndObject(); }