Hi,
I'm trying to print a document in landscape, but i'm only being able to print it in portrait.
I've searched for the problem but i haven't found a solution to the problem.
Can you, please help?
Here's the source code:
public void btnImprimir_Click()
{
try
{
PrintDialog pDialog = new PrintDialog();
pDialog.PrintQueue = System.Printing.LocalPrintServer.GetDefaultPrintQueue();
pDialog.PrintTicket = pDialog.PrintQueue.DefaultPrintTicket;
// set default paper size or remove this line to use the default size
pDialog.PrintTicket.PageMediaSize = new System.Printing.PageMediaSize
(System.Printing.PageMediaSizeName.ISOA4Rotated);
Nullable<Boolean> print = pDialog.ShowDialog();
if (print == true)
{
W.MyFlowDocument.PageWidth = 2950;
W.MyFlowDocument.PageHeight = 2100;
DocumentPaginator myDocumentPaginator = ((IDocumentPaginatorSource)W.MyFlowDocument).DocumentPaginator;
//myDocumentPaginator = new DocumentPaginatorWrapper(myDocumentPaginator, new System.Windows.Size(750, 1200), new System.Windows.Size(48, 48));
myDocumentPaginator = new DocumentPaginatorWrapper(myDocumentPaginator, new System.Windows.Size(2950, 2100), new System.Windows.Size(48, 48));
myDocumentPaginator.PageSize = new System.Windows.Size(2950, 2100);
pDialog.PrintDocument(myDocumentPaginator, "Test");
}
}
catch (Exception err)
{
}
}