Click here to Skip to main content
15,878,748 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
So, I have a WPF-control, and I have printed it into xps-file.
I can see this file with XPS Viewer - and it is correct.
Moreover, I can print it with XPS Viewer - and have got correct hard copy.
But if trying to do this from my C# code - I can get only blank page.
More details - all works good with simple xps file, but doesn't work with my application-generated file.

Here is code to print:

C#
var server = new PrintServer(serverName);

var queue = new PrintQueue(server, printerName);
{
    var size = new PageMediaSize(PageMediaSizeName.ISOA4);
    queue.UserPrintTicket.PageMediaSize = size;
    var job = queue.AddJob("jobname", file, false);
    {
    }
}


Here is my xps-file
https://drive.google.com/file/d/0BxMl8yVSfSsSd0RkeUlraHJ6S3c/view?usp=sharing[^]

Thank you!
Posted

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