コード例 #1
0
        //
        // rendering
        //

        protected override PDFObjectRef DoOutputToPDF(PDFRenderContext context, PDFWriter writer)
        {
            if (context.ShouldLogVerbose)
            {
                context.TraceLog.Begin(TraceLevel.Verbose, "Layout Page", "Starting the render of Page: " + this.PageIndex);
            }
            else if (context.ShouldLogMessage)
            {
                context.TraceLog.Add(TraceLevel.Message, "Layout Page", "Rendering layout page " + this.PageIndex);
            }

            //get the current style and aply it to the style stack
            Style style = this.FullStyle;

            context.StyleStack.Push(style);

            PageSize pagesize = this.PageOwner.GetPageSize(style);
            //PDFPageNumbering num = this.GetNumbering(style);
            //this.Document.RegisterPageNumbering(context.PageIndex, this, num);
            PDFObjectRef last = writer.LastObjectReference();
            PDFObjectRef pg;

            pg = DoWritePage(context, writer, last);



            context.StyleStack.Pop();

            if (context.ShouldLogVerbose)
            {
                context.TraceLog.End(TraceLevel.Verbose, "Layout Page", "Completed the rendering of page: " + this.PageIndex);
            }

            return(pg);
        }
コード例 #2
0
        protected override void WriteCatalogEntries(PDFRenderContext context, PDFWriter writer)
        {
            if (null != this.OriginalFile)
            {
                PDFObjectRef catalog  = writer.LastObjectReference();
                PDFObjectRef pageTree = this.OutputPageTree(context, writer);

                foreach (KeyValuePair <PDFName, IFileObject> item in this.ExistingCatalog)
                {
                    if (item.Key.Value == "Pages")
                    {
                        //PDFObjectRef pages = this.OutputAllPages
                        writer.BeginDictionaryEntry(item.Key);
                        pageTree.WriteData(writer);
                        writer.EndDictionaryEntry();
                    }
                    else
                    {
                        writer.BeginDictionaryEntry(item.Key);
                        item.Value.WriteData(writer);
                        writer.EndDictionaryEntry();
                    }
                }
            }
            else
            {
                base.WriteCatalogEntries(context, writer);
            }
        }