Print Page | Close Window

PrintDocumentToFile - file will not release

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2790
Printed Date: 04 Apr 26 at 7:28PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: PrintDocumentToFile - file will not release
Posted By: Marvin
Subject: PrintDocumentToFile - file will not release
Date Posted: 28 Nov 13 at 9:01AM
I am helpless :) One function of my Application is to convert PDF Files to Postscript by using the PrintDocumentToFile function.
So far so good, but the file will not write to the desired destination, while my application is running.
It is shown in the windows spooler and will release if my application is stopped.

I call the printer class, that uses the QuickPdf Library, within a using-Block and in addition i use a Garbage Collect after that.

So i can't explain it to me, why the file will be released before the application stopped.
May be there is a closure missing, like CloseDoc to release the Document?

Here is a short version of my code:
private void PrintToFile()
{
   var cp = objPDF.NewCustomPrinter(_PrinterName);
   objPDF.SetupCustomPrinter(cp, 5, 1);           // Set Quality

   var iPrintOptions = objPDF.PrintOptions(_PageScaling, 1, Path.GetFileName(_PrintFileName));

   objPDF.PrintDocumentToFile(cp, _StartPage, _EndPage, iPrintOptions, _OutputFile);
}

Does anyone have any idea why this is so?

Thanks Lutz.



Replies:
Posted By: Marvin
Date Posted: 28 Nov 13 at 2:07PM
Hi Guys, it works!
After a upgrade from 9:14 to 9:16 version of the library it works again.
Anyone who can read, have a clear advantage
Thanks all.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk