I use Microsoft Visual Studio 2017 and Microsoft Print to PDF in Windows 10.
I try to make a PDF file of FlowDocument without PrintDialog and I know it's impossible in pure WPF. So I referred system.drawing.printing.PrintDocument of Windows Forms into my WPF project.
I'm stuck on the point of converting FlowDocument to PrintDocument.
PrintDocument _PrintDocument = (PrintDocument)FlowDocument1;
IDocumentPaginatorSource _DocumentPaginatorSource = FlowDocument1;
PrintDocument _PrintDocument = FlowDocument1;
Neither of them works.
Is it possible or is there any sideway to make PDF by assigning the folder and file name with code? Should I surely use 3rd party component?
Print to PDF
,Print to File
orPrint to XPS
do.PrintDocument
is a class used for printing, not generating files – Panagiotis Kanavos