使用 .NET 发送传真

发布于 2024-07-14 08:26:29 字数 262 浏览 3 评论 0原文

我正在尝试使用 Crystal Reports 和 Unimessage Pro(或任何其他传真程序)通过 .NET (C#) 程序发送传真。

我的问题是 Unimessage Pro(和其他传真程序)使用打印机字体作为传真命令。 由于 .NET 不支持打印机字体,因此报告中的传真命令将转换为 Courier New。 其结果是传真程序无法识别传真命令,而是将它们视为纯文本,并且不发送传真。

如何使用 Crystal Reports 和 .NET 发送传真?

I'm trying to send faxes with a .NET (C#) program using Crystal Reports and Unimessage Pro (or any other fax program).

My problem is that Unimessage Pro (and other fax programs) uses printer fonts for the fax commands. Since .NET doesn't support printer fonts the fax commands in the report are converted to Courier New. The result of this is that the fax program doesn't recognize the fax commands but sees them as plain text and the fax isn't sent.

How do I send a fax with Crystal Reports and .NET?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

醉态萌生 2024-07-21 08:26:29

我从 WordCraft(Unimessage Pro 背后的公司)得到了这个答案

  1. 在 Windows 主文件夹中创建一个名为 WilCapAX.INI 的文件,例如
    C:\Windows\WilCapAX.INI 文件
    应包含以下内容:
    [威尔卡普克斯]
    Commands=C:\Commands.DAT 其中“C:\Commands.DAT”是
    您要创建的文本文件
    在您的 .NET 应用程序中传递
    Unimessage Pro 的嵌入式命令。
    如果需要,您可以编辑路径,
    但请保留简短的文件格式
    文件夹名称。

  2. 在您的 .NET 应用程序中,当您有东西要通过
    发送时
    Unimessage Pro 然后您需要:

    2.1 创建一个文本文件,命名为,根据定义的名称
    在 WilCapAX.INI, C:\Commands.DAT 中包含:

    <前><代码> 空行
    [[TO=传真号码或电子邮件地址]]
    [[SUBJECT=无论你想要什么主题]]

    文件的第一行必须为空或包含
    除了嵌入式命令之外的其他东西 - 它将是
    跳过了。 C:\Commands.DAT 文件中的其他行
    每个都应该包含一个嵌入式命令。

    2.2 将一条消息打印到 Unimessage Pro 打印机 -
    Unimessage Pro 打印机接受打印作业并将
    查找 WilCapAX.INI 中指定的文件。 如果
    WilCapAX.INI (C:\Commands.DAT) 中指定的文件是
    发现,嵌入的命令被从中提取出来并
    然后“C:\Commands.DAT”文件被删除并且
    打印捕获与命令一起处理
    从 C:\Commands.DAT 文件中提取。

    2.3 等待C:\Commands.DAT文件消失
    (表示已被处理
    Unimessage Pro 打印机),然后根据需要重复。

这解决了问题! :)

I got this answer from WordCraft (company behind Unimessage Pro)

  1. Create a file named WilCapAX.INI in the main Windows folder, e.g.
    C:\Windows\WilCapAX.INI The file
    should contain the following:
    [WilCapAX]
    Commands=C:\Commands.DAT Where "C:\Commands.DAT" is the name of
    a text file you are going to create
    in your .NET application to pass the
    embedded commands to Unimessage Pro.
    You can edit the path if necessary,
    but keep to short form file and
    folder names.

  2. In your .NET application when you have something to send via
    Unimessage Pro you then need to:

    2.1 Create a text file named, depending on the name defined
    in WilCapAX.INI, C:\Commands.DAT containing:

     BLANK LINE
     [[TO=Fax Number or Email address]]
     [[SUBJECT=Whatever you want the subject to be]]
    

    The first line of the file must either be blank or contain
    something other than an embedded command - it will be
    skipped. The other lines in the C:\Commands.DAT file
    should each contain an embedded command.

    2.2 Print ONE message to the Unimessage Pro printer - the
    Unimessage Pro printer accept the print job and will
    look for the file specified in WilCapAX.INI. If the
    file specified in WilCapAX.INI (C:\Commands.DAT) is
    found, embedded commands are extracted from it and
    then the "C:\Commands.DAT" file is deleted and the
    print capture processed together with the command
    extracted from the C:\Commands.DAT file.

    2.3 Wait for the C:\Commands.DAT file to disappear
    (indicating that it has been processed by the
    Unimessage Pro printer) and then repeat as necessary.

This solved the problem! :)

别把无礼当个性 2024-07-21 08:26:29

Joyfax 客户端控制台 1.0(测试版)

注意:运行此应用程序之前,请先安装 Joyfax 客户端 v5.2 或更高版本。

JoyfaxConsole [选项] -f [;...][;FileN] -r ""

-f  file or folder  Files or files in sub folders to be faxed.
        i.e: C:\Test\;C:\MyPDFs\*.pdf
-r      Recipients  Recipient list. For more see Fax Recipients. Must begin and end with double quotation marks(").

选项:

-a  Synchronous Wait until fax sent completed;
-s  Subject Subject of fax, i.e.: "Joyfax Sell Sheet";
-m  Meno Memo of fax, i.e.: "Joyfax Server 5-user license";
-c  CoverPage Cover Page profile to be used;
-d  Header Header & footer profile to be used,
    0 = None; 1 = General; 2 = Compact; 3 = Detailed
-k  Kill Delete input files if fax sent successfully.

返回:

0 - Success;
1 - Initialize failed;
2 - Invalid parameter;
3 - Unknown erorr (may unsupported file type).

示例:

JoyfaxClientConsole -d 2 -f "C:\My PDFs\D90.PDF" -r "Samm
Kivin<866-6554-564>;先生。 绿色<(846)6554-564>"

JoyfaxClientConsole -f C:\MyPDFs*.pdf;D:\Sell.xls -r "Samm
基文<866-6554-564>"

JoyfaxClientConsole -s "Joyfax 销售表" -m "Joyfax 服务器 5 用户
许可证" -f D:\Sell.xls -r "Kivin<866-6554-564>"

Joyfax Client Console 1.0 (beta)

Note: Please lanuch Joyfax Client v5.2 or above before runnig this application.

JoyfaxConsole [Options] -f [;...][;FileN] -r ""

-f  file or folder  Files or files in sub folders to be faxed.
        i.e: C:\Test\;C:\MyPDFs\*.pdf
-r      Recipients  Recipient list. For more see Fax Recipients. Must begin and end with double quotation marks(").

Options:

-a  Synchronous Wait until fax sent completed;
-s  Subject Subject of fax, i.e.: "Joyfax Sell Sheet";
-m  Meno Memo of fax, i.e.: "Joyfax Server 5-user license";
-c  CoverPage Cover Page profile to be used;
-d  Header Header & footer profile to be used,
    0 = None; 1 = General; 2 = Compact; 3 = Detailed
-k  Kill Delete input files if fax sent successfully.

Retrun:

0 - Success;
1 - Initialize failed;
2 - Invalid parameter;
3 - Unknown erorr (may unsupported file type).

Example:

JoyfaxClientConsole -d 2 -f "C:\My PDFs\D90.PDF" -r "Samm
Kivin<866-6554-564>;Mr. Green<(846)6554-564>"

JoyfaxClientConsole -f C:\MyPDFs*.pdf;D:\Sell.xls -r "Samm
Kivin<866-6554-564>"

JoyfaxClientConsole -s "Joyfax Sell Sheet" -m "Joyfax Server 5-user
license" -f D:\Sell.xls -r "Kivin<866-6554-564>"

久随 2024-07-21 08:26:29

当您说使用打印机字体时,我假设您需要发送一些 PCL(或类似)命令,例如:

<esc>(s..... 

如果是这种情况,我认为您不能直接将其嵌入到 Crystal 中。

过去我们必须通过 Crystal 发送特殊序列(没有 Escape),在这些情况下,我们创建一个新的公式框,并且不更改字体以外的任何元素(选择 Courier)。 这些元素应直接传递到打印机,而不会被驱动程序进行过多转换。 这可能; 但是,并不能解决你的问题。

另一个可行的选择是使用 Microsoft 的驱动程序开发工具包构建您自己的打印机驱动程序。 您可以创建自己的迷你驱动程序并将字体与特定字体调用关联起来,这样当您指定该字体时,您就可以将代码正确插入到您的代码中。

您也可以按照我们的方式处理此问题(不是使用 Crystal,而是使用另一个类似的报告)。 我们使用 RightFax 作为传真服务器,它允许通过元数据文件“附加”文件。 我们生成报告,将其以 PDF 或其他格式放入特定位置,然后向 RightFax 传递一个元数据文件,其中包含收件人的传真号码和一条命令,告诉它将该文件附加到文件系统上。

RightFax“附加”文件如下所示:

{{begin}}
{{nocover}}
{{fax (403) 555-1212}}
{{subject Test Fax}}
{{attach c:\reports\report1.pdf delete}}
{{imagetype pdf}}
{{end}}

When you say uses printer fonts, I'm assuming that you need to send some PCL (or similar) commands such as:

<esc>(s..... 

If that's the case I don't think you can embed that in that with Crystal directly.

We've had to send special sequences in the past through Crystal (without the Escape), in these cases we create a new Formula box and don't change any of the elements other then the font (choose Courier). These elements should pass right to the printer without being converted too much by the driver. This may; however, not solve your problem.

The other option that should work is to build your own printer driver with Microsoft's Driver Development Kit. You can create your own Mini Driver and associate a font with a specific font call so when you specify that font you get the code inserted into your code properly.

You could also process this in the manner that we do (not with Crystal but another similar reporting too). We use RightFax as our fax server and it allows for the 'attachment' of files through a metadata file. We generate the report, put it into a specific location as a PDF or other format and then pass RightFax an metadata file that contains the fax number of the recipient and a command that tells it to attach the file on the filesystem.

The RightFax 'attach' file looks something like this:

{{begin}}
{{nocover}}
{{fax (403) 555-1212}}
{{subject Test Fax}}
{{attach c:\reports\report1.pdf delete}}
{{imagetype pdf}}
{{end}}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文