BeginContent() 공개 메소드

Initializes the default view transformation, i.e. the transformation from the user page space to the PDF page space.
public BeginContent ( bool hacks4softmask ) : void
hacks4softmask bool
리턴 void
예제 #1
0
        void RealizeVisualBrush(VisualBrush brush, ref XForm xform)
        {
            //Debug.Assert(xform != null);

            xform = new XForm(writer.Owner, new XRect(brush.Viewbox.X * 3 / 4, brush.Viewbox.Y * 3 / 4, brush.Viewbox.Width * 3 / 4, brush.Viewbox.Height * 3 / 4));

            Visual           visual     = brush.Visual;
            PdfContentWriter formWriter = new PdfContentWriter(writer.Context, xform, RenderMode.Default);


            //formWriter.Size = brush.Viewport.Size;
            formWriter.BeginContent(false);
            formWriter.WriteElement(visual);
            formWriter.EndContent();
        }
예제 #2
0
    void RealizeVisualBrush(VisualBrush brush, ref XForm xform)
    {
      //Debug.Assert(xform != null);

      xform = new XForm(this.writer.Owner, new XRect(brush.Viewbox.X * 3 / 4, brush.Viewbox.Y * 3 / 4, brush.Viewbox.Width * 3 / 4, brush.Viewbox.Height * 3 / 4));

      Visual visual = brush.Visual;
      PdfContentWriter formWriter = new PdfContentWriter(this.writer.Context, xform, RenderMode.Default);


      //formWriter.Size = brush.Viewport.Size;
      formWriter.BeginContent(false);
      formWriter.WriteElement(visual);
      formWriter.EndContent();
    }
예제 #3
0
        internal void RenderPage(PdfPage page, FixedPage fixedPage)
        {
            this.page = page;

            context = new DocumentRenderingContext(page.Owner);

            //this.page.Width = fixedPage.Width;
            //this.page.Height = fixedPage.Height;

            //this.gsStack = new GraphicsStateStack(this);
            PdfContent content = null;

            //switch (options)
            //{
            //  case XGraphicsPdfPageOptions.Replace:
            //    page.Contents.Elements.Clear();
            //    goto case XGraphicsPdfPageOptions.Append;

            //  case XGraphicsPdfPageOptions.Prepend:
            //    content = page.Contents.PrependContent();
            //    break;

            //  case XGraphicsPdfPageOptions.Append:
            content = page.Contents.AppendContent();
            //    break;
            //}
            page.RenderContent = content;

            writer = new PdfContentWriter(context, this.page);

            //Initialize();

            writer.BeginContent(false);
            writer.WriteElements(fixedPage.Content);
            writer.EndContent();
        }
예제 #4
0
        /// <summary>
        /// Creates an XForm from a visual brush.
        /// </summary>
        public static XForm FromVisualBrush(DocumentRenderingContext context, VisualBrush brush)
        {
            //XPImage xpImage = ImageBuilder.FromImageBrush(context, brush);
            //XImage ximage = xpImage.XImage;
            double width  = brush.Viewport.Width;
            double height = brush.Viewport.Height;

            // view box in point
            // XRect box = new XRect(brush.Viewbox.X * 0.75, brush.Viewbox.Y * 0.75, brush.Viewbox.Width * 0.75, brush.Viewbox.Height * 0.75);
            XRect box   = new XRect(0, 0, width, height);
            XForm xform = new XForm(context.PdfDocument, box);

            PdfContentWriter formWriter = new PdfContentWriter(context, xform, RenderMode.Default);
            PdfFormXObject   pdfForm    = xform.PdfForm;

            pdfForm.Elements.SetMatrix(PdfFormXObject.Keys.Matrix, new XMatrix());

            //formWriter.Size = brush.Viewport.Size;
            formWriter.BeginContent(false);
            formWriter.WriteElement(brush.Visual);
            formWriter.EndContent();

            return(xform);
        }
예제 #5
0
    /// <summary>
    /// Creates an XForm from a visual brush.
    /// </summary>
    public static XForm FromVisualBrush(DocumentRenderingContext context, VisualBrush brush)
    {
      //XPImage xpImage = ImageBuilder.FromImageBrush(context, brush);
      //XImage ximage = xpImage.XImage;
      double width = brush.Viewport.Width;
      double height = brush.Viewport.Height;

      // view box in point
      // XRect box = new XRect(brush.Viewbox.X * 0.75, brush.Viewbox.Y * 0.75, brush.Viewbox.Width * 0.75, brush.Viewbox.Height * 0.75);
      XRect box = new XRect(0, 0, width, height);
      XForm xform = new XForm(context.PdfDocument, box);

      PdfContentWriter formWriter = new PdfContentWriter(context, xform, RenderMode.Default);
      PdfFormXObject pdfForm = xform.PdfForm;
      pdfForm.Elements.SetMatrix(PdfFormXObject.Keys.Matrix, new XMatrix());

      //formWriter.Size = brush.Viewport.Size;
      formWriter.BeginContent(false);
      formWriter.WriteElement(brush.Visual);
      formWriter.EndContent();

      return xform;
    }