GemBox.Pdf.Examples
GemBox.Pdf.Examples copied to clipboard
Printing is not working
Even when using the print.pdf console example, printing does not work. It is a exception of file is in use by a process.
This is even when using the 'using' keyword for automatic disposing of the loaded pdf document.
For clarity, nothing is using the file. I have confirmed such with both IOBit Unlocker and file locksmith. The issue could only be your code trying to open two streams on the same file at once (PdfDocument.Load opens a stream, for example)
Hi,
I was unable to reproduce this issue. Can you try using this:
var bytes = File.ReadAllBytes("input.pdf");
var stream = new MemoryStream(bytes);
using (var document = PdfDocument.Load(stream))
document.Print("printer name");
Does this work for you?
Regards, Mario