c# examples

If you are a C/C++/C# developer and have any questions about using our products from your application here is the place to post them.
Post Reply
Giuseppe Ferlisi
Posts: 22
Joined: Thu Oct 03 2002
Location: Germany

c# examples

Post by Giuseppe Ferlisi »

Hi there,

are they any samples in c# managed code.

Giuseppe
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hello,

Below is C# code snippet which illustrates how to implement the PDF Converter. Hope this helps?

private void btnPrintTextObject_Click(object sender, System.EventArgs e)
{
CDIntfEx.CDIntfEx PDF = new CDIntfEx.CDIntfExClass() ;
PDF.DriverInit ( PDFprinter);

PDF.DefaultDirectory = "c:\\temp";
//Complete path of resulting PDF document
PDF.DefaultFileName = "c:\\temp\\fromCsharp.pdf";

//Set printer as default
PDF.SetDefaultPrinter();

PDF.FileNameOptionsEx = (int)(sNoPrompt + sUseFileName);
PDF.EnablePrinter (strLicenseTo, strActivationCode);

//Print Something
printDocument1.Print();

PDF.RestoreDefaultPrinter();
PDF.FileNameOptions = 0;
}

Thanks
Giuseppe Ferlisi
Posts: 22
Joined: Thu Oct 03 2002
Location: Germany

C# Samples

Post by Giuseppe Ferlisi »

Hi,

thanks. We try to use the CDIntfNet.dll.

...
public event CDIntf.eveEnabledPre oPDFc_EnablePr;
...

oPDFc = new CDIntf.CDIntfControl();
oPDFc.DriverInit ("myprinter");
try
{
oPDFc.EnablePrinter(strCompany,strSerial);
oPDFc.DefaultDirectory = "c:\\";
oPDFc.DefaultFileName = "c:\\test.pdf";
oPDFc.CaptureEvents (true);
}
catch
{
}

1.)The problem is that we get no event. The oPDFc.EnabledPre is not compatible with the System.EventHandler.
2.)There is no FileNameOptionsEx funktion.

Giuseppe
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Please send this issue to support@amyuni.com

Also please note that you can use FileNameOptions instead of FileNameOtionsEx and you mainly need to call EnablePrinter before printing.

Thanks
Post Reply