Hello,
I have a similar issue:
- Code: Select all
using ClientUtils.Interfaces;
using Spire.Pdf;
using Spire.Pdf.Print;
namespace ClientUtils;
public class Printer : IPrinter
{
public void Print(string fullFilePath, string printerName)
{
PdfDocument doc = new ();
doc.LoadFromFile(fullFilePath, FileFormat.PDF);
if (!string.IsNullOrEmpty(printerName))
{
doc.PrintSettings.PrinterName = printerName;
}
doc.PrintSettings.SelectSinglePageLayout(PdfSinglePageScalingMode.ActualSize, false);
doc.PrintSettings.SetPaperMargins(0, 0, 0, 0);
doc.Print();
}
}
this can be compiled using FreeSpire.PDF 8.6.0 or SpirePdf 10.3.7 but not using FreeSpire.PDF 10.2.0:
Screenshot 2024-03-27 102232.png
0>Printer.cs(16,17): Error CS1061 : 'PdfDocument' does not contain a definition for 'PrintSettings' and no accessible extension method 'PrintSettings' accepting a first argument of type 'PdfDocument' could be found (are you missing a using directive or an assembly reference?)
0>Printer.cs(19,13): Error CS1061 : 'PdfDocument' does not contain a definition for 'PrintSettings' and no accessible extension method 'PrintSettings' accepting a first argument of type 'PdfDocument' could be found (are you missing a using directive or an assembly reference?)
0>Printer.cs(22,13): Error CS1061 : 'PdfDocument' does not contain a definition for 'PrintSettings' and no accessible extension method 'PrintSettings' accepting a first argument of type 'PdfDocument' could be found (are you missing a using directive or an assembly reference?)
0>Printer.cs(24,13): Error CS1061 : 'PdfDocument' does not contain a definition for 'Print' and no accessible extension method 'Print' accepting a first argument of type 'PdfDocument' could be found (are you missing a using directive or an assembly reference?)
0>------- Finished building project: ClientUtils. Succeeded: False. Errors: 4. Warnings: 1
Sincerely
Alex
Login to view the files attached to this post.