Ejemplo n.º 1
0
        private PDFLayoutXObject CreateAndAddInput(PDFPositionOptions pos)
        {
            PDFLayoutBlock  containerBlock  = this.DocumentLayout.CurrentPage.LastOpenBlock();
            PDFLayoutRegion containerRegion = containerBlock.CurrentRegion;

            if (containerRegion.HasOpenItem == false)
            {
                containerRegion.BeginNewLine();
            }
            //pos.Y = 200;
            PDFLayoutRegion container = containerBlock.BeginNewPositionedRegion(pos, this.DocumentLayout.CurrentPage, this.Component, this.FullStyle, false);

            this.Line = containerRegion.CurrentItem as PDFLayoutLine;
            PDFLayoutXObject begin = this.Line.AddXObjectRun(this, this.Field, container, pos, this.FullStyle);

            return(begin);
        }
        protected virtual PDFLayoutXObject ApplyViewPort(PDFPositionOptions oldpos, PDFRect viewPort)
        {
            //Set the size to the viewport size
            var newpos = oldpos.Clone();

            newpos.X = viewPort.X;
            newpos.Y = viewPort.Y;

            //update to new widths
            newpos.Width  = viewPort.Width;
            newpos.Height = viewPort.Height;

            //Set the style values to the viewport too. (and reset the cache)

            this.FullStyle.Size.Width  = newpos.Width.Value;
            this.FullStyle.Size.Height = newpos.Height.Value;

            if (this.FullStyle is Scryber.Styles.StyleFull)
            {
                (this.FullStyle as StyleFull).ClearFullRefs();
            }

            PDFLayoutBlock  containerBlock  = this.DocumentLayout.CurrentPage.LastOpenBlock();
            PDFLayoutRegion containerRegion = containerBlock.CurrentRegion;

            if (containerRegion.HasOpenItem == false)
            {
                containerRegion.BeginNewLine();
            }
            //pos.Y = 200;
            PDFLayoutRegion container = containerBlock.BeginNewPositionedRegion(newpos, this.DocumentLayout.CurrentPage, this.Component, this.FullStyle, false);

            this.Line = containerRegion.CurrentItem as PDFLayoutLine;



            PDFLayoutXObject begin = this.Line.AddXObjectRun(this, this.Component, container, newpos, this.FullStyle);

            begin.SetOutputSize(oldpos.Width, oldpos.Height);


            //this.CurrentBlock.IsFormXObject = true;
            //this.CurrentBlock.XObjectViewPort = pos.ViewPort.Value;

            return(begin);
        }