Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1420
Printing in silverlight
posted

I have managed to print a page, here is what I did:

I added "Silverlight.Reporting.dll" reference to my project and I added UserControl page which I fill with needed data and I print with this code:

PrintDocument document = new PrintDocument();

document.PrintPage += (s, args) =>
{
args.PageVisual = LayoutRoot;

args.HasMorePages = false;

HideAllOuterControls();
};
document.EndPrint += (s, args) =>
{
ShowAllOuterControls();
};

document.Print("Ticket Report");

This prints page just fine. I have one issue so far dough and that is it prints until the certain height of the page. Namely if I have on my page (height 800px) a border control from top to bottom (height 780px) I press PRINT and on the paper I can only see top 600px of the rectangle (roughly 600) - I can't see the bottom line at all?? I wonder why is this?? Cause THERE IS a plenty of space below to fit the hole rectangle.

Is there something I am missing? Some additional settings maybe, please help.

P.S. I am planing to put my printing to child window later...

Best regards

Marko.