svishnevsky / PDFtoPrinter

.Net Wrapper over PDFtoPrinter util allows to print PDF files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The system cannot find the file specefied

Qurishe opened this issue · comments

@svishnevsky i am using PDFtoPrinter v1.5.0 in my UWP application and it throws the error: The system cannot find the file specified.
at first i suspected that it may be because UWP doesn't have full access to the file system and i placed my pdf file in UWP LocalState folder which by default UWP application has access to, but still it throws the same error. since it prints using path, i am unable to provide the file.

Here is my piece of code for printing PDF file:

public async Task PrintPDF()
{
StorageFolder temp = ApplicationData.Current.TemporaryFolder;
string printerName = "EPOS8080";
string filePath = temp + "\report.pdf";
var printer = new PDFtoPrinterPrinter();
await printer.Print(new PrintingOptions(printerName, filePath));
return filePath;
}