Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

iam writing a custome paginator for flowdocument. i used Matrix Transform to set the position of the Condainervisual .suppose if i set the MatrixTransform as new MatrixTransform(1,0,0,1,0,140) that means that particular CondainerVisual
will start from offsety(140) and if i have a footer in my page the condense of that CondainerVisual will float over the footer because we r setting matrixTransform.offsety(140).how can i avoid this.can we set the size of condainervisual so that condense will only fit with that size and we can stop the data floating over the footer.
iam attaching the code .

public override DocumentPage GetPage(int pageNumber) {
    DocumentPage source = paginator.GetPage(pageNumber);                  // Returns next page for processing
    DrawingVisual result = new DrawingVisual();                           // This is the target output structure
    result.Children.Add(Header());                                        // Needs no transformation
    IContentHost contentHost = (IContentHost)source;
    HostedElements(contentHost,result);
    ContainerVisual body = new ContainerVisual();
    body.Children.Add(source.Visual);
    body.Transform = pageNumber == 0 ? new MatrixTransform(1,0,0,1,0,100) : new MatrixTransform(1,0,0,1,0,140);
    result.Children.Add(body);
    result.Transform = new TranslateTransform(margin.Width,margin.Height);
    ContainerVisual footer = Footer(pageNumber);
    footer.Transform = new MatrixTransform(1,0,0,1,0,820);                // Move to bottom of page
    result.Children.Add(footer);
    isPageBreak = true;
    return new DocumentPage(result,size,source.BleedBox,source.ContentBox);
  }


Regards,
sajith
Posted
Updated 5-Mar-12 17:31pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900