PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Migradoc WPF Printing
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1180
Page 1 of 1

Author:  allanob [ Wed May 12, 2010 10:27 am ]
Post subject:  Migradoc WPF Printing

I have followed the instructions to print a Migradoc WPF Document, but I donĀ“t know how to set the printing defaults:
Code:
            string dll = MigraDoc.DocumentObjectModel.IO.DdlWriter.WriteToString(document);

            MigraDoc.Rendering.Forms.DocumentPreview docPre = new MigraDoc.Rendering.Forms.DocumentPreview();
            docPre.Ddl = dll;


            MigraDoc.Rendering.DocumentRenderer renderer = docPre.Renderer;
                       
            System.Windows.Controls.PrintDialog dialog = new System.Windows.Controls.PrintDialog();
            dialog.UserPageRangeEnabled = true;
            bool? result = dialog.ShowDialog();

            if (result == true)
            {
                MigraDoc.Rendering.Printing.MigraDocPrintDocument printDocument = new MigraDoc.Rendering.Printing.MigraDocPrintDocument();

                // Attach the current printer settings   
               printDocument.PrinterSettings = ???????????????;
               
               if (this.printerSettings.PrintRange == PrintRange.Selection)

                printDocument.SelectedPage = ???????.Page;                                 
                printDocument.Renderer = renderer;

                printDocument.Print();
            }


Is it a way in WPF???

Author:  Thomas Hoevel [ Wed May 12, 2010 1:55 pm ]
Post subject:  Re: Migradoc WPF Printing

I don't know how to set these parameters.

Bad news: currently printing doesn't work with the WPF build. Use the GDI build for that.

Author:  Zoidberg [ Thu Jan 13, 2011 11:56 am ]
Post subject:  Re: Migradoc WPF Printing

Are there any news concerning this subject? I need a way to print a MigraDoc.DocumentObjectModel.Document (in WPF) directly.

Author:  Thomas Hoevel [ Thu Jan 13, 2011 12:26 pm ]
Post subject:  Re: Migradoc WPF Printing

Zoidberg wrote:
I need a way to print a MigraDoc.DocumentObjectModel.Document (in WPF) directly.

You can use the GDI+ build of PDFsharp/MigraDoc even for WPF applications.

Author:  SamJost [ Fri Feb 03, 2012 3:23 pm ]
Post subject:  Re: Migradoc WPF Printing

Thomas Hoevel wrote:
Zoidberg wrote:
I need a way to print a MigraDoc.DocumentObjectModel.Document (in WPF) directly.

You can use the GDI+ build of PDFsharp/MigraDoc even for WPF applications.


So it is not possible to use the WPF DocumentViewer and to directly print documents both in the same program?

Such a pity! Where is the problem? Printing from the documentviewer works, so it should be possible, not?

Kind regards,
Sam

Author:  () => true [ Fri Feb 03, 2012 6:29 pm ]
Post subject:  Re: Migradoc WPF Printing

It's a bug in version 1.31. I hope it will be fixed with the next release.

Should be a simple problem, but we did not investigate it yet.

Author:  SamJost [ Mon Feb 06, 2012 9:00 am ]
Post subject:  Re: Migradoc WPF Printing

Ah ok, the old issue with too much work and too little time.

Thanks for the explanation! I just wondered if there might be a tough technical problem hidden here.

The next release is not really imminent, due to the same reasons, I guess?

Ah, I see. In WPF the printing routines are not yet converted from System.Drawing.Printing to System.Printing? Pity, the routines behind MigraDoc are great!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/