Comments (12)
Hi @JeffSE97062
Do you run the application with the same permission level as you have? Have you tried to run the app As Administrator?
from pdftoprinter.
I did try running as administrator and the file still wasn't removed.
from pdftoprinter.
Is the application a long running one like service or web server or it exists immediately after sending a file to a printer?
from pdftoprinter.
Exits immediately.
from pdftoprinter.
from pdftoprinter.
Thanks! And thanks for putting this together.
from pdftoprinter.
Hi @JeffSE97062
Could you please try the 1.4.2 version and confirm that it solves your issue?
To turn on awaiting of file deletion you need to pass "true" to CleanupFilesPrinter constructor like below:
new CleanupFilesPrinter(new PDFtoPrinterPrinter(), true);
from pdftoprinter.
Hi @svishnevsky, same issue with the 1.4.2. The file is not removed.
from pdftoprinter.
Do you use a similar approach like below?
`var wrapper = new CleanupFilesPrinter(new PDFtoPrinterPrinter(), true);
await wrapper.Print(new PrintingOptions("Microsoft Print to PDF", "somefile.pdf"));'
from pdftoprinter.
Yes.
`
class Program
{
static void Main(string[] args)
{
print();
}
static async void print()
{
// Delete after printing. Doesn't seem to work.
var wrapper = new CleanupFilesPrinter(new PDFtoPrinterPrinter(), true);
await wrapper
.Print(new PrintingOptions(
Properties.Settings.Default.Printer,
Properties.Settings.Default.FileToPrint)
);
}
}`
from pdftoprinter.
Thanks for sharing the code. You call the "print" method with no await, so your application exists before a Task is completed. Could you please try something like:
static sync Task Main(string[] args) { await print() }
or
static void Main(string[] args) { print(),GetAwaiter().GetResult(); }
from pdftoprinter.
That worked. Thanks.
from pdftoprinter.
Related Issues (20)
- We Can Print Silent HOT 4
- .net 5 support without -windows HOT 4
- Is this working on windows service HOT 4
- PdfToPrint.exe is missing HOT 4
- Network printer not working HOT 4
- The system cannot find the file specified HOT 6
- Resize PDF HOT 3
- File not found when printing from web service HOT 10
- Multi Printer HOT 2
- select printer tray HOT 1
- Suggestion: Print PDF from a stream HOT 1
- use `<PublishSingleFile>true</PublishSingleFile>` not found directory name. HOT 2
- File structure changes when publishing HOT 5
- focus parameter
- The system cannot find the file specefied HOT 1
- Issue with printing with concurrency that one of the files stays with PDF XChange Viewer open blocking HOT 15
- execute multiple time HOT 1
- 打印不同文件且不同份数 请问如何实现
- Portrait and Landscape Printing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdftoprinter.