Printing after conversion From WinForms Net. 4.8 to WinForms Net 8

In a WinForms app in Net. 4.8 we use the following code to generate a print preview:

Document document;
AsposeWordsPrintDocument asposeWordsPrintDocument = new AsposeWordsPrintDocument(document);
  
PrintPreviewDialog previewDialog = new PrintPreviewDialog();
previewDialog.Document = asposeWordsPrintDocument;
previewDialog.ShowDialog();

The class “AsposeWordsPrintDocument” seems to be no longer available in Net 8. What is the best way to reach the same goal in Net 8?

Thanks in advance!

@JNeck AsposeWordsPrintDocument extends System.Drawing.Printing.PrintDocument class. System.Drawing is not fully supported by .NET core and is available only fir Windows with System.Drawing.Comment package. Therefore Aspose.Words for .NET Standard 2.0 and .NET6 does not use System.Drawing to deal with graphics and uses SkiaSharp instead. Unfortunately, .NET Standard 2.0 and .NET6 version of Aspose.Words does not support printing and print preview. If it is required to simply show document preview, you can convert your document to image and show this image.

Thank you very much for your prompt response!

No good news but we will try to implement this the suggest way via document to image conversion.

1 Like