Hi,
I'm using PDFCreator in a c# class library project (which outputs a single dll-file) which again is a part of a bigger solution that also contains a web application. The web application uses the class library to access functions like the PDFCreator.
I've followed the .Net guide on how to use PDFCreator and I've imported both 'acPDFCreator.Net' and 'acPDFCreatorLib.Net' and I've placed 'using Amyuni.PDFCreator' in my code to use PDFCreator.
First, I get an error saying PDFCreator requires the System.Windows.Forms dll in my project. Why is this needed? I'm using the creator in code-behind, not in the aspx-page. If this was a GUI c# project I'd understand, but it's a web application code-behind that uses PDFCreator.
Secondly, perhaps because of this usage of the forms-components, the instantiation of the PDFCreator often throws "Error creating windows handle"-exception, even though I'm disposing the pdfcreator-object.
Am I using the correct PDFCreator component for usage in code-behind?
Any suggestions would be sweet.
PDFCreator in code-behind class library project (C#)
Re: PDFCreator in code-behind class library project (C#)
In this situation, 'acPDFCreator.Net' should not be imported. This DLL contains the UI components which cannot be used in your code-behind application. You need to import 'acPDFCreatorLib.Net' only and use the classes and methods provided by this library.
Amyuni Development Team
Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - https://www.amyuni.com
Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - https://www.amyuni.com