I've downloaded the Amyuni Evaulation for the PDF Converter (v5.0.0.7 I believe), and I'm having trouble getting the sample code that comes with it to work.
I installed the the printer using the code and license name in the text file in the folder, and updated the code and license name in the sample code. I then ran the sample app, using the Print To Text" button. I removed the flag to suppress the dialog. (PDF.FileNameOptionsEx = (int) sUseFileName;)
When I get to line
printDocument1.Print();
I throw an error: "The parameter is incorrect"
I'm not sure what it is I'm doing wrong.
Can anyone provide me some direction as to what I can check. Obviously I've gotten something wrong, I just don't know what it is.
Developer Evaluation of Driver
Re: Developer Evaluation of Driver
Hello,
What you are experiencing seems a little odd. Can you please replace the code you are using with the code below?
I suspect the Amyuni PDF Converter is not able to find or create the resulting PDF document file name.
/// <summary>
/// This code snippet illustrates how to print
/// from the Amyuni PDF Converter using the printer object
/// </summary>
private void btnPrintText_Click(object sender, System.EventArgs e)
{
//Declare object
CDIntfEx.CDIntfEx PDF = new CDIntfEx.CDIntfEx();
//Initialize printer
PDF.DriverInit(PDFprinter);
PDF.DefaultFileName = "c:\\temp\\print_text.pdf";
//This tells the PDF Converter not to prompt the user for a file name
//and us the filename specified in the DefaultFileName() method
PDF.FileNameOptionsEx = (int) sNoPrompt + sUseFileName;
string currentPrinter = printDocument1.PrinterSettings.PrinterName;
printDocument1.PrinterSettings.PrinterName = PDFprinter;
//This function needs to be called right before each print job
PDF.EnablePrinter(strLicenseTo, strActivationCode);
//Print something
printDocument1.Print();
PDF.FileNameOptions = 0;
printDocument1.PrinterSettings.PrinterName = currentPrinter;
}
Thanks
What you are experiencing seems a little odd. Can you please replace the code you are using with the code below?
I suspect the Amyuni PDF Converter is not able to find or create the resulting PDF document file name.
/// <summary>
/// This code snippet illustrates how to print
/// from the Amyuni PDF Converter using the printer object
/// </summary>
private void btnPrintText_Click(object sender, System.EventArgs e)
{
//Declare object
CDIntfEx.CDIntfEx PDF = new CDIntfEx.CDIntfEx();
//Initialize printer
PDF.DriverInit(PDFprinter);
PDF.DefaultFileName = "c:\\temp\\print_text.pdf";
//This tells the PDF Converter not to prompt the user for a file name
//and us the filename specified in the DefaultFileName() method
PDF.FileNameOptionsEx = (int) sNoPrompt + sUseFileName;
string currentPrinter = printDocument1.PrinterSettings.PrinterName;
printDocument1.PrinterSettings.PrinterName = PDFprinter;
//This function needs to be called right before each print job
PDF.EnablePrinter(strLicenseTo, strActivationCode);
//Print something
printDocument1.Print();
PDF.FileNameOptions = 0;
printDocument1.PrinterSettings.PrinterName = currentPrinter;
}
Thanks
Get PDF Suite, the expert .NET developer toolkit for PDF conversion, creation and editing - www.amyuni.com/pdfsuite
-
- Posts: 4
- Joined: Tue Aug 12 2008
Re: Developer Evaluation of Driver
Okay, it works....
I see your code used the CDIntfEx.CDIntfEx instead of CDIntfEx.CDIntfExClass, but that did not seem to be the issue.
It turns out that I caused my own issue when I tried to turn back on the prompt.
I modified the following line
PDF.FileNameOptionsEx = (int)sNoPrompt + sUseFileName;
to
PDF.FileNameOptionsEx = (int)sUseFileName;
Regardless, thank you for your response.
I see your code used the CDIntfEx.CDIntfEx instead of CDIntfEx.CDIntfExClass, but that did not seem to be the issue.
It turns out that I caused my own issue when I tried to turn back on the prompt.
I modified the following line
PDF.FileNameOptionsEx = (int)sNoPrompt + sUseFileName;
to
PDF.FileNameOptionsEx = (int)sUseFileName;
Regardless, thank you for your response.